-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dark NEF image compared to other RAW viewer #1
Comments
Thanks for the report. I don't know your level of experience with RAW files so forgive me in advance if this is too basic of an explanation. Two things are happening: First what geeqie is showing you has nothing to do with the raw data. Geeqie is simply reading the embedded jpeg thumbnail in the NEF that's been processed by the camera. It's as if you had loaded a camera JPG instead of a NEF. Second rawloader's main purpose is to decode raw data, as in the mosaic bayer data (one color per pixel) that the sensor actually captures so that other software can do all the interesting things it may want to do with that data. For convenience and as an example rawloader also ships a very simple raw pipeline that is able to create linear or sRGB images from that data. Raw images are linear and require a base curve to look good. Right now the rawloader pipeline includes a very simple curve: There's probably a better standard curve that works for more cases, I haven't invested a lot of time making it better but it should be at least reasonable for most cases. Eyeballing the NEF I'd say the first effect is the biggest and that fancy auto-adjust features like Nikon's Active D-Lighting are enabled in the camera and it has adjusted the picture from a darker RAW into that JPG thumbnail. I can have a look at the NEF to see if that's the case. |
Thank you for the thourough reply and explanation. I am indeed quite the novice when it comes to raw formats. Funnily though I actually learned about debaying earlier yesterday when I tried to wrap my head around the code in rawloader. I was under the impression that the raw image's embedded JPEG has way too low resolution to use on a computer. When I've tried to open NEFs they sometimes show a tiny thumbnail. I made a side by side comparison with Photoshop's CameraRaw as well (without touching the sliders): Here is the NEF i use: taipei101.nef.zip It does indeed seem like I am willing to experiment with this. Are you interested in pull requests for features like this? Optional automatic rotation is the thing currently on my TODO list. Here is the EXIF data from
|
Almost all cameras have a large JPG in the raw thumbnail. That's often what's used to display on the camera screen when you are in RAW only mode and on external screens through HDMI for example (in which case 1080p thumbnails are common). Your camera goes one step further and includes a 4928x3264 JPG thumbnail which seems to be a full sized image. They probably did that to allow for 1:1 in-camera viewing. The reason you probably saw very small thumbnails is that some cameras include several thumbnails, some really small, and in some cases the format is readable as a normal TIFF but only showing that one small thumbnail. So if you use software that isn't raw aware you get that small poor image. Anyway, raw processing is fast enough these days that there's no real point in using the thumbnails, it will only lead to poor color matching and confusing interfaces. rawloader can generate a 500px wide thumbnail from a 24MP image in 200-300ms which together with caching is more than enough for all uses. As for this specific NEF it does seem the default curve makes it a bit too dark. A better default curve would be nice and PRs are welcome for that. Automatic rotation would also be welcome and it was on my TODO list. The biggest issue for that is getting the metadata from all the different formats. Once you know the orientation it's easy enough to apply it. The most performant way is to do it in src/imageops/demosaic.rs by doing coordinate swaps/flips. A cleaner but slightly slower way is to just do a new image operation that just does the flipping of the pre-demosaic data (but then also needs to adjust the bayer pattern). |
I've tried the Canon EOS600D this weekend. Using Rawloader with it seems to produce darker images too. Though it is not as apparent as with the NEF files. I don't know if Canon has an equivalent to Active D-Lighting. I made a side by side comparison of what Rawloader and CameraRaw (without adjustments) produces: Like my NEF above it is darker. It seems that Rawloader produces slightly red-tinted images in both cases. Which part of the decoding process could be responsible for that? |
Raws are a matter of interpretation. For me the image on the left is better but raws are not about the defaults, but letting the user change things at will. A red tint could be because of a different whitebalance setting or again a different curve. |
In an artistic sense for this particular image I agree that the left one is more appealing. However, the one on the right is what the camera preview shows as well as being much closer to reality. I'd find it less confusing if the default settings produced something similar to what I've already seen on the camera, or another previewer. I have no objections about allowing the current result as an optional profile/preset. |
I'm all for good defaults and the curve I set is pretty crude. Feel free to change the curve to something you think is more reasonable and do a PR with that. It's all nicely done in parameters anyway: |
I don't know what I was smoking at the time but the original curve made no sense. I've set what looks like a more reasonable default curve in imagepipe. You may want to try the converter program there (or chimper) to see if it looks a bit better. |
Transferred the issue to imagepipe as that's where the curve code now is. |
The red is a different issue. The camera probably used a different whitebalance and/or color matrix. The comparison there would have to be to the Adobe tools to be meaningful and even then we wouldn't know what they're doing exactly. |
Hey, foremost, love your work. I am too very new to raw in general and learned a lot from reading through the repos you have. |
I tried out the library with NEF files from my Nikon D7000. I have used Geeqie before and I find that the images are much darker in rawloader:
On the left the raw file is displayed by Geeqie and on the right the same image decoded by rawloader. I decoded it into a PPM image and then used imagemagick to convert that to a TIFF.
The code I used for converting to PPM is based on the one from the README:
To convert the PPM to TIFF I used:
I can provide the NEF if necessary.
The text was updated successfully, but these errors were encountered: