timelapse-deflicker icon indicating copy to clipboard operation
timelapse-deflicker copied to clipboard

Use gamma correction instead of changing the brightness?

Open cyberang3l opened this issue 9 years ago • 1 comments

After some reading, as I understand the brightness changes (that I use in this script) are linear for the whole tonal range, but gamma changes are not. Since the images are gamma encoded, it makes sense to "want" to change the gamma value instead of the brightness, in order to have the "same" perceived brightness-change effect in the highlights and shadows.

This are some notes for me:

Debug gamma and other imagemagick functions on command line:
http://www.cambridgeincolour.com/tutorials/gamma-correction.htm
   convert DSC_8400.JPG -gamma 1 jpg:- | display jpg:-
   convert DSC_8400.JPG -colorspace Gray -gamma 2.2 jpg:- | display jpg:-
   convert DSC_8400.JPG -colorspace Gray -gamma 2.2 jpg:- | identify -verbose jpg:-
   convert DSC_8400.JPG -format "%[gamma]\n" info:
# my $gamma = (1 / ( $luminance{$i}{original} / $luminance{$i}{value} ));

cyberang3l avatar Apr 25 '15 12:04 cyberang3l

Some more notes: convert -format '%c' DSC_8400.JPG -colorspace YIQ histogram:info:- $image->Mogrify( 'modulate', brightness => $value );

cyberang3l avatar May 19 '15 20:05 cyberang3l