Some PNG files are incorrectly recolored
Swiss army knife of image processing
Brought to you by:
bfriesen
Hi,
after using the recolor function on some PNG (not all), output is incorrect - see attachments. I'm using matrix for recoloring to grayscale:
[ 0.3, 0.59, 0.11, 0.0, 0.0],
[ 0.3, 0.59, 0.11, 0.0, 0.0],
[ 0.3, 0.59, 0.11, 0.0, 0.0],
[ 0.0, 0.0, 0.0, 1.0, 0.0],
[ 0.0, 0.0, 0.0, 0.0, 1.0]
I recolored same PNGs using ImageMagick and outputs are absolutely OK.
What version of GM and libpng are you using?
Type "gm convert | head -1" and "gm convert -list format | grep PNG" to find out.
GraphicsMagick 1.3.18 2013-03-10 Q8 http://www.GraphicsMagick.org/
Portable Network Graphics (libpng 1.2.49,1.2.50, zlib 1.2.8)
(I installed it from default Ubuntu repository using apt-get package manager)
Please verify that the original.png retrieved from the SourceForge bug report is the same as what you uploaded. SourceForge's web site has a habit of re-writing uploaded PNG files. For example, it is 8-bit PNG now but perhaps it was 16-bit PNG before. If the file is not the same, perhaps it will work better if you change the extension to something like ".bin" or included it in a zip file.
With the file currently attached to the bug report, this works ok for me with GraphicsMagick 1.3.20. Please note that a problem with reading 16-bit PNG files using a Q8 build was fixed in 1.3.19. The read problem produced output similar to your recolored.png example:
Bob
This may be a duplicate of bug #206
We did not get any response regarding verifying that original.png was not modified. I am assuming that the problem encountered was already fixed in 1.3.19.