1

Using GraphicsMagick to read in a PNG file and write it out under a different name is causing the file size to increase by more than double. This only happens to some PNG files and I can't figure out what is causing it.

Example problem PNG: http://www.google.co.in/logos/2011/verne-hp-3.png

I have tried everything from disabling the opacity channel to using different compression types to changing the interlacing type but nothing is helping me understand what is causing this problem.

If anyone has any suggestions on what might be causing this, your help would be very welcome.

Thank you.

toc777
  • 2,607
  • 2
  • 26
  • 37

1 Answers1

2

The file is an indexed-color PNG with alpha stored in a tRNS chunk. When I rewrite this file to disk GM uses RGBA PNG, which causes the image size to increase.

toc777
  • 2,607
  • 2
  • 26
  • 37
  • Have you managed to find a solution? If yes, could you help me out with this: http://stackoverflow.com/questions/5818603/issues-porting-php-gd-wrapper-to-imagick? – Alix Axel Apr 28 '11 at 15:13
  • The downside to using OptiPNG is it is quite slow but try it out to see if its ok for your use case because it is an excellent tool. – toc777 Apr 29 '11 at 10:41