Search code examples
image-processingpngimagemagickgraphicsmagickimage-compression

Tell GraphicsMagick to keep tRNS chunk for alpha values when writing out a file


I am using GraphicsMagick to reduce the file size of PNG images. Some PNG files have their alpha values conveyed in a tRNS chunk to optimize their file size. The problem is GM is writing these files out as RGBA PNG's which is radically increasing their file size, as much more space is needed to store the alpha channel.

Does anyone know how to specify to GraphicsMagick or even ImageMagick to use the original alpha encoding rather than defaulting to RGBA?


Solution

  • I have found out from the maintainers of GraphicsMagick that this functionality has not yet been implemented in ImageMagick or GraphicsMagick. However, the feature is being implemented right now so it may be available in the near future.