Page 1 of 1

libpng warning: Ignoring incorrect gAMA value when sRGB is also present

Posted: 2016-07-05T16:29:35-07:00
by cbelth
I have run the command:

Code: Select all

convert -flop image.png mirrored_image.png
to mirror an image. It worked, and examining the result, it is correct. However, I then went to resize the result with the following:

Code: Select all

convert mirrored_image.png -resize 256x256 resize_image.png
and it throws the following error:
libpng warning: Ignoring incorrect gAMA value when sRGB is also present
Anyone know how to solve this?

Re: libpng warning: Ignoring incorrect gAMA value when sRGB is also present

Posted: 2016-07-05T18:07:33-07:00
by fmw42
What is your IM version and platform? Please always provide that. See viewtopic.php?f=1&t=9620

Also what is your version of libpng? It might be old and need an update.You can find it from

Code: Select all

convert -list format

Re: libpng warning: Ignoring incorrect gAMA value when sRGB is also present

Posted: 2016-07-05T20:53:01-07:00
by snibgo
The problem is probably this:

In some versions of IM (or perhaps some versions of linpng), using "-gamma XX" to adjust mid-tones of pixels would also adjust the metadata gamma setting. But some versions of IM or libpng expect the gamma metadata to always be 0.454545 when a sRGB profile is present.

The cure is not to use "-gamma XX", but "-evaluate Pow YY" where YY = 1/XX.

When a file shows this warning, the workaround is "-set gamma 0.454545". This changes the metadata without changing the pixels.