Add new comment

Question about using output_params to render an sRGB image

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.