Pngcrush

From EpixStudios

Jump to: navigation, search

Brutal compressing of PNG images

PNG images used in web layouts can be significantly compressed by using a tool called pngcrush.

This is easily installed on Gentoo with:

emerge -av pngcrush

It can simply be used with the command:

pngcrush input.png output.png

However if you're going to go to the trouble of compressing PNGs you may as well use some agressive methods. The most agressive options I use are:

pngcrush -brute -rem gAMA -rem cHRM -rem iCCP -rem sRGB -rem tIME -rem tEXT -rem iTXt -rem zTXt input.png output.png

The -brute option tries all crushing methods rather than use one of a few common methods. Other ancillary chunks can be removed using '-rem [chunk name]' as above. These are all the valid chunks that may be included in a PNG.

  • bKGD gives the default background color. It is intended for use when there is no better choice available, such as in standalone image viewers (but not web browsers, although Internet Explorer 6 and lower, which does not support alpha transparency, will display this color as the background of the PNG).
  • cHRM gives the white balance.
  • gAMA specifies gamma.
  • hIST can store the histogram, or total amount of each color in the image.
  • iCCP is an ICC color profile.
  • iTXt contains UTF-8 text, compressed or not, with an optional language tag.
  • pHYs holds the intended pixel size and/or aspect ratio of the image.
  • sBIT (significant bits) indicates the color-accuracy of the source data.
  • sPLT suggests a palette to use if the full range of colors is unavailable.
  • sRGB indicates that the standard sRGB color space is used.
  • tEXt can store text that can be represented in ISO 8859-1, with one name=value pair for each chunk.
  • tIME stores the time that the image was last changed.
  • tRNS contains transparency information. For indexed images, it stores alpha channel values for one or more palette entries. For truecolor and greyscale images, it stores a single pixel value that is to be regarded as fully transparent.
  • zTXt contains compressed text with the same limits as tEXt.


http://en.wikipedia.org/wiki/Pngcrush

http://en.wikipedia.org/wiki/Portable_Network_Graphics

http://pmt.sourceforge.net/pngcrush/

Personal tools