PNG image becomes too bright

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
oleksiy
Posts: 12
Joined: 2014-11-22T16:53:32-07:00
Authentication code: 6789

PNG image becomes too bright

Post by oleksiy »

An sRGB PNG image becomes too bright even with no processing options specified:

Code: Select all

convert test.png test2.png
test.png: https://www.dropbox.com/s/6ia85553der2lwu/test.png?dl=0
test2.png: https://www.dropbox.com/s/mexp6kl69msiw ... 2.png?dl=0


ImageMagick 6.9.0-3 Q16 x86_64

Thanks!
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: PNG image becomes too bright

Post by snibgo »

The images seem identical.

test.png has a gamma setting of 2.2, which is very high. More usual numbers would be 0.454545 (which is 1/2.2, for sRGB) or 1.0 (for linear RGB).

Code: Select all

convert test.png -set gamma 0.454545 t.png
snibgo's IM pages: im.snibgo.com
oleksiy
Posts: 12
Joined: 2014-11-22T16:53:32-07:00
Authentication code: 6789

Re: PNG image becomes too bright

Post by oleksiy »

Yes, thats strange, probably Dropbox shows modified images and it corrects the problem. Please download them as original from Dropbox (with right click) and you'll see the difference.

Here is a screenshot of how the second image looks after 'convert':

https://www.dropbox.com/s/6ynfkwqhn2k8d ... 3.png?dl=0
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: PNG image becomes too bright

Post by snibgo »

I did download as you say.

What software made test.png? Why does it have gamma=2.2 instead of the more usual 1/2.2? Some software will ignore this setting and assume it is really 1/2.2. Other software, like Firefox and ImageMagick, will use this setting and so it appears bright.

The cure is to put the proper setting into test.png.
snibgo's IM pages: im.snibgo.com
Post Reply