Curious IM7 behavior with "-gamma"
Posted: 2017-03-20T10:31:04-07:00
Using IM 7.0.5-3 HDRI on Windows 10 64, I've come across a combination of operations that creates an odd result. If I run this command...
... it creates this image with the text colored yellow, even though I changed the "-fill" color to white before the "-annotate" operation.
(https://www.dropbox.com/s/s0ex05me0at3g ... .png?raw=1)
Notice the "-gamma" value is 0.99, barely below 1, but any value greater or less than 1 will result in yellow text. Here are some things I tried to narrow the source of the issue.
If I set the gamma to 1 using "-gamma 1.00", the result is white text as expected.
If I put "-gamma" operation before the "-tint" instead of after it, the text will be white.
If I substitute "-level 0%,100%,0.99" for the "-gamma 0.99" operation, the text will be white.
Some tint colors will create this effect and others don't. If I use "-fill #FF00FF" before the tint, the text in the output will be white as expected. If I do "-fill #00FFFF" before the tint, the resulting text will be cyan. It doesn't seem to matter if I designate the colors by name, percentages, etc.
If I run the exact same command only using "convert" from IM 6.9.7-6 HDRI, the text is white.
Obviously there are several ways to bypass the problem, but I wonder if it's something that might need some attention from the developers in order to avoid some other possible side effects.
Code: Select all
magick -size 400x100 gradient: -fill #FFFF00 -tint 100% -gamma 0.99 ^
-gravity center -fill #FFFFFF -pointsize 48 -annotate +0+0 "TESTING 123" v7_099.png
(https://www.dropbox.com/s/s0ex05me0at3g ... .png?raw=1)
Notice the "-gamma" value is 0.99, barely below 1, but any value greater or less than 1 will result in yellow text. Here are some things I tried to narrow the source of the issue.
If I set the gamma to 1 using "-gamma 1.00", the result is white text as expected.
If I put "-gamma" operation before the "-tint" instead of after it, the text will be white.
If I substitute "-level 0%,100%,0.99" for the "-gamma 0.99" operation, the text will be white.
Some tint colors will create this effect and others don't. If I use "-fill #FF00FF" before the tint, the text in the output will be white as expected. If I do "-fill #00FFFF" before the tint, the resulting text will be cyan. It doesn't seem to matter if I designate the colors by name, percentages, etc.
If I run the exact same command only using "convert" from IM 6.9.7-6 HDRI, the text is white.
Obviously there are several ways to bypass the problem, but I wonder if it's something that might need some attention from the developers in order to avoid some other possible side effects.