Add new comment

Problem when emulating dcraw document mode

Hi everyone,

I'm currently using LibRaw to extract a completely raw image without any interpolation or processing, similar to dcraw's document mode (dcraw -D -4). I'm attempting to achieve this by setting the following parameters:

params.no_iterpolation = 1;
params.gamm[1] = 1;
params.output_bps = 16;
params.output_color = 0;
params.no_auto_scale = 1;
params.no_auto_bright = 1;
params.highlight = 1;
params.adjust_maximum_thr = 0;

(Note: I am using Java and accessing the LibRaw C API through JNA, so I'm setting these parameters manually.)

The output works as expected and I get a raw image. However, when I compare the result from LibRaw to that from dcraw, I notice a small discrepancy: the pixel values from LibRaw are consistently 1 less than those from dcraw. I only get identical results when I set params.user_cblack = {-1, -1, -1, -1}.

Does anyone know why this discrepancy occurs? Is there something specific in how dcraw handles black level compensation or another internal parameter that I'm missing in LibRaw?

Any insights would be greatly appreciated!

Forums: