-flatten causes gamma-shift
Posted: 2014-12-14T09:52:54-07:00
A new bug was introduced sometime between 6.8.9-5 and 6.9.0-0. (Windows 8.1, Q16 binary distribution.)
For greyscale inputs, "-flatten" causes a shift in the gamma value, from 1/2.2 to 1.
Test case:
Results:
"-layers flatten" shows the same problem.
The problem occurs only when the input contains no colour. If the input contains transparency, so the flatten introduces colour, the gamma is shifted to 1.
For greyscale inputs, "-flatten" causes a shift in the gamma value, from 1/2.2 to 1.
Test case:
Code: Select all
convert -size 1x1 xc:#888 f0.png
convert f0.png -background Red -flatten f0_out.png
identify -format "f0.png gamma = %%[gamma]\n" f0.png
identify -format "f0_out.png gamma = %%[gamma]\n" f0_out.png
Code: Select all
f0.png gamma = 0.45455
f0_out.png gamma = 1
The problem occurs only when the input contains no colour. If the input contains transparency, so the flatten introduces colour, the gamma is shifted to 1.