Hi,
I am using libraw to render a 16-bit sRGB image from a RAW file. I understand that I need to set certain fields of output_params to enable this correctly. My settings based on my understand is below:
rp.imgdata.params.use_camera_wb = 1; // Use As Shot White Balance
rp.imgdata.params.output_bps = 16; // 16-bit output
rp.imgdata.params.no_auto_bright = 1; // Do not contrast stretch the image
rp.imgdata.params.output_color = 1; // sRGB space
rp.imgdata.params.gamm[0] = 1/2.4; // power for sRGB
rp.imgdata.params.gamm[1] = 12.92; // toe slope for sRGB
I expected this to match the dcraw_emu call:
dcraw_emu -w -o 1 -g 2.4 12.92 -T -W -6
but when I compare my output with the resulting TIFF file, there is a mismatch. Are my params settings correct to render 16-bit sRGB image?
I am unclear what the -6 option does because it talks says "Write 16-bit linear instead of 8-bit with gamma". I do not understand what it means.
Regards,
Dinesh
dcraw_emu uses same dcraw
dcraw_emu uses same dcraw_process() call, so with same parameters output should be the same.
-6 results in 16-bit output:
case '6':
OUT.output_bps = 16;
break;
(looks like docs need to be corrected)
-- Alex Tutubalin @LibRaw LLC
Fixed by https://github.com
Fixed by https://github.com/LibRaw/LibRaw/commit/c6339c13a991571822518d13e7288012...
-- Alex Tutubalin @LibRaw LLC
Thanks!
Hi Alex,
Thanks for confirming the settings are the same and for updating the help. However, I am getting differences for a RAW file from LEAF. I am providing a link to the file below:
https://drive.google.com/file/d/1HkNwHiFGjRaz7y6nd6lWlO6W0BVE5p1z/view?u...
My workflow is
open_file()
unpack()
// Set the imgdata.params as described above
get_mem_image_format(...)
dcraw_process()
dcraw_make_mem_image()
// Copy the rendered image
For a NEF file in my possession, it works fine.
Regards,
Dinesh
Link is not accessible
Link is not accessible
-- Alex Tutubalin @LibRaw LLC
Apologies!
Fixed the link permissions. Here is the link again:
https://drive.google.com/file/d/1HkNwHiFGjRaz7y6nd6lWlO6W0BVE5p1z/view?u...
Dinesh
Cloned your settings into mem
Cloned your settings into mem_image_sample.cpp:
compared with
Results are the same:
-- Alex Tutubalin @LibRaw LLC
Thanks!
Alex,
I am using 0.19.6 version + I am on Windows. I will look into my code and confirm my implementation is correct. Would it be possible for you to send me the PPM files for me to compare?
Regards,
Dinesh
https://www.dropbox.com/s
https://www.dropbox.com/s/19dm6nmr47fg0ua/raw_leaf_aptus_22.mos.ppm?dl=0
-- Alex Tutubalin @LibRaw LLC