Clipping of over-exposed image


I am just wondering what is the best way to avoid clipping and preserve the highlight? Currently thinking of four options:

highlight = 1;
exp_correc = 1;
exp_shift = 0;
exp_preser = 1

Thanks a lot!




I actually set "no_auto_bright" to 1, it actually clipped the white to 1.0.

Thanks a lot!

Data range is 0...65535 for

Data range is 0...65535 for 16-bit output, what is '1.0' mean?

Also, could you please upload some clipped file to test with?

-- Alex Tutubalin

Yea - "Data range is 0 to

Yea - "Data range is 0 to 65535 for 16-bit output, the max is 65535". The RAW file for testing is 4 stops above. I can upload it tomorrow. Thanks!



I print out the code values after "libraw" processing. They are all within the range of "0 - 65535".

The settings that I use before "dcraw_make_mem_image (...)" are:

output_color = 5;
output_bps = 16;
highlight = 0;
use_camera_matrix = 0;
gamm[0] = 1.0;
gamm[1] = 1.0;
auto_bright_thr = 0;
no_auto_bright = 1;

I tried to upload the RAW file, but the file size is big and the format cannot be recognized.

Thanks a lot!

Is all three files are

Is all three files are clipped or only latest one?

-- Alex Tutubalin

The last one (the bottom-left

The last one (the bottom-left patch). Now the bottom-left patch has the similar code values as the ones of the patch next to it on the right.

Thanks a lot!

Hi, thanks for the quick

Hi, thanks for the quick reply!

The file appears to be clipped in the camera in the white patch on the bottom-left; however, the patch directly to the right of it isn’t. The conversion seems to clip both patches to the same or similar value. Can you look into this again?

Thanks so much!

more general command line to avoid clipping

Hi all,

I take the opportunity of this comment to know what are the options to be used in command line (e.g. through dcraw_emu) to avoid any clipping. It seems that a clipping is done systematically whatever the different options...

By the way, I did not find an explanation of the 'gamma_curve' function which does different things depending on the 'mode' input...

Thanks for the help



-U float-number changes auto

-U float-number changes auto-brightness threshold (default value is 0.01 so 1% of pixels brightened to clipping), so -U 0.0 may be useful

-W option turns auto-brightness completely off

-- Alex Tutubalin

Hi Alex,

Hi Alex,

Thanks for more information!

Is "-U 0.0" same as "auto_bright_thr = 0.0"?

Also, if I use "user-black = 0", will there be no "black subtraction" before demosaic?

I printed out the "data_maximum" value from a RAW, why the "data_maximum" is 0 before processing and 4095 after processing. Should it be same before and after?



Yes, -U switch sets auto

Yes, -U switch sets auto_bright_thr.

Most likely you do not want to turn off black subtraction.

data_maximum is calculated during processing.

-- Alex Tutubalin