Main Operation
The main use of pngcrush is for reducing the size of the image data contained in the IDAT section.
The pixel data in a PNG file is compressed using LZ77 algorithm (which tries to find repeated byte sequences in the source data), and then further compressed with Huffman algorithm. This combination is referred to as DEFLATE compression. Before compressing, non-destructive delta filters are applied on the pixel data.
There are 5 possible filter types which can be specified separately on each scan line. In addition, there are several possible strategies of searching LZ77 matches. Thus, there is almost infinite number of different combinations on how the image can be compressed. Which combination gives the best compression depends on the image properties.
pngcrush compresses the image with multiple different combinations and then stores the smallest of the resulting files. Since it is not possible to go through all the combinations, pngcrush uses some heuristics to choose the methods to try.
In the simplest form, pngcrush can be told to generate a "crushed" file from an unoptimized one by using the following format on the command line:
pngcrush imageIn.png imageOut.pngBy default, pngcrush uses just a few common methods to crush the file. The optional "-brute" argument can be used for brute force crushing, which will try more than 100 different crushing methods.
Read more about this topic: Pngcrush
Famous quotes containing the words main and/or operation:
“One of the main things that interfere with our joy is the belief that if we try hard enough, read the right books, follow the right advice, and buy the right things, we could be perfect parents. If we are good enough as parents, our children will be perfect too.... Unfortunately, what comes from trying to live out this philosophy is not perfect children but worried parents.”
—Lawrence Kutner (20th century)
“An absolute can only be given in an intuition, while all the rest has to do with analysis. We call intuition here the sympathy by which one is transported into the interior of an object in order to coincide with what there is unique and consequently inexpressible in it. Analysis, on the contrary, is the operation which reduces the object to elements already known.”
—Henri Bergson (18591941)