timelapse-deflicker
timelapse-deflicker copied to clipboard
Use gamma correction instead of changing the brightness?
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} ));
Some more notes:
convert -format '%c' DSC_8400.JPG -colorspace YIQ histogram:info:-
$image->Mogrify( 'modulate', brightness => $value );