Final followup: you probably need to turn off auto-maximum detection via dcraw_emu -c 0
You probably need to either use unprocessed raw values or program your own (simple) postprocessing.
Please define "linear behaviour" and maybe demonstrate with numbers over a grey step wedge what you mean.
DNGs don't have brightness. First, brightness isn't an attribute of a digital image; second, there is no such thing as standard calibration for raw.
This needs to be said, sorry.
I see, thanks. As I said though, gamma is not really a problem. Even if I set gamma to 1 I do not see the linear behaviour that I'd like to get (https://imgur.com/a/a1C3cfV for just a few images), while I do get it with the DNG SDK and unprocessed_raw.
Left to right:
dcraw_emu -W 00.dng
dcraw_emu -W -g 1 0 00.dng
If TIFF output used for -g.... one may be fooled by TIFF viewer if the viewer is ICC-aware
1) when using dcraw_emu, -g 1 0 doesn't seem to have an effect on top of -W. I actually don't have a problem with having a non-unitary gamma, as long as it is the same on all images. I can compensate for that later in the processing.
2) White Balance is not really a problem neither, I have a neutral area in the target I'm imaging and I will in any case perform white balance using that.
3) I did look at unprocessed_raw and it does give a linear output. However, it returns images before demosaicing, which I'd prefer not to have to code in myself, since I'd assume libRAW has significantly better functionality for this than I can code. I'd rather invest time into trying to get linear output from built-in functionality than having to code demosaicing.
So, what I'd like to find out is if there is something we can do to get rid of that extra processing that happens in dcraw_emu -W, but without going as far back as unprocessed_raw.
Also, your 'tif' files are not white-balanced, probably you may want to set custom 'Uni-WB' white balance.
Also, if you want to get unscaled/unaltered data extracted: take a look for unprocessed_raw and/or 4channels LibRaw samples.
>> for half the exposure time I get half the pixel value
If you need 'linear output' you probably may want to set output gamma to 1.0
You can find an example dataset here https://drive.google.com/drive/folders/1X4Cqj-hhLXOktWsfFN4e2yfWWZI5BGHK...
There you can find
1) DNG images from the camera
2) JPG images automatically generated by the camera (I use those to get exposure times from EXIF data)
3) TIF images obtained using the stage3 output of the Adobe DNG SDK
4) PPM images obtained using dcraw_emu.exe -W (which should be equivalent to what described in this comment https://www.libraw.org/comment/6511#comment-6511)
I like the TIF images because for half the exposure time I get half the pixel value, across the exposure range. The PPM images are not predictable, which implies that some extra processing is happening. Please see the original attachment for a plot of image average (across all pixels, all channels) VS exposure time.
Sorry, I didn’t realize right away that I was already talking with two people.
Could you please formulate your problem not referring to the 'OP'. Also, it would be great to have RAW file(s) in question еo discuss something in specific detail and not in the abstract.
Original post, here https://www.libraw.org/node/2740
He uses -W which is no_auto_bright but has that issue
Sorry, what is 'OP' ?
This creates images like in the OP, with unpredictable gamma.
Yes, this should(*) turn off auto-ETTR/auto-scaling, so this will result into dark(er) images.
(*) we're not responsible for AndroidLibRaw so not absolutely sure set....() calls works as expected.
I use the unofficial Android port https://github.com/dburckh/AndroidLibRaw
openBuffer(bytes, bytes.size) setAutoBrightness(false) setAutoScale(false) decodeBitmap(BitmapFactory.Options())
which should apply the options:
no_auto_bright = true
no_auto_scale = true
Could you please clarify: you use LibRaw library from your application, or some LibRaw sample programs 'as is' (as a command-line utility)
I'm also struggling with this. Can you point out which command do I need to use to turn it off?
It was tagged while creating release files downloads for this site, export script works on tags.
Github release was created on your request
Great, thank you. It looks like you tagged it earlier today. I use the cmake repo for building so the missing configure is not a big deal.
Already tagged: https://github.com/LibRaw/LibRaw/tree/0.21.0
Official release is available via this site download section: https://www.libraw.org/download
Github release has been created too: https://github.com/LibRaw/LibRaw/releases/tag/0.21.0
(although github release does not contain generated ./configure script)
Auto-ETTR is performed on output stage, while converting from linear internal representation to gamma-corrected output in LibRaw::write_tiff_ppm or LibRaw::copy_mem_image
Thanks. I tried different combinations of the options in the list you linked, but no luck.
Can you point me to where I can access settings for Auto-ETTR in the source code?
rgb_cam is used to construct camera to output RGB matrix: https://github.com/LibRaw/LibRaw/blob/master/src/postprocessing/postproc...
Cmatrix is the same, it may be copied to rgb_cam if corresponding params option is set and the matrix is not empty: https://github.com/LibRaw/LibRaw/blob/master/src/metadata/identify.cpp#L...
Spot on! 0-21 works perfectly.