Google
 
   
Login
Username:

Password:


Lost Password?

Register now!
Search
Main Menu
top books
Polls
What do you think about php-deluxe.net?
Excellent!
Cool
Hmm..not bad
What the hell is this?
encyclopedia
recommendation
compare webbrowser
Freenet DSL
Who's Online
7 user(s) are online (6 user(s) are browsing encyclopedia)

Members: 0
Guests: 7

more...
browser tip
Unix Befehle
manual of unix befehle
recommendation!
Sponsored
partner

Pngcrush

pngcrush is an open source, free software command line computer program that reduces the size of PNG files. The compression is lossless, meaning that the resulting image will have the same quality as the source image. The main purpose of pngcrush is to reduce the size of the PNG IDAT datastream by trying various compression levels. However, pngcrush can also be used for various manipulations of PNG images, such as changing the color depth. Some operations can even increase the file size.

There is an optional -brute option, which performs a brute force crush when set: rather than use one of a few common methods to crush the file, it will try all of them.

=Main operation=

The main use of pngcrush is for reducing the size of the image data contained in the IDAT section. PNG compression can vary in quality, from nearly no compression at all to the tightest optimisations possible. The PNG compressors built into many paint programs often do not apply the best compression, and it is on images output from them that pngcrush performs its role.

pngcrush generates an optimised file from an unoptimised one using the following format on the command line:

pngcrush image1.png image2.png

=Image manipulation=

pngcrush can be used to change the parameters of an image. For example, if an image contains 10 colours but has a colour palette of 256 entries (8-bit), pngcrush can be used to reduce the colour palette to a 4-bit one and truncate the palette to 10 entries:

pngcrush -bit_depth 4 -plte_len 10 image1.png image2.png

pngcrush can also change the colour type of the image. For a truecolour image, changing the colour type from 2 to 0 (-c 0) converts it to greyscale. For a truecolour-alpha image, changing the colour type from 6 to 2 removes the alpha channel.

=Chunk and metadata manipulation=

PNG images contain chunks with information about the image, such as its resolution (the pHYs chunk), the time it was last modified (the tIME chunk) and textual metadata (the tEXt chunk and its variants). With pngcrush the user can edit or remove those ancillary chunks:

pngcrush -res 96 -rem tIME -text b Software pngcrush image1.png image2.png

The above command sets the image resolution to 96 dpi, removes the timestamp and writes a textual metadata chunk describing pngcrush as the creation software of the image.

=See also=

Other PNG compression programs include:

*AdvanceCOMP *OptiPNG

=External links=

*[http://pmt.sourceforge.net/pngcrush/ pngcrush] *[http://gnuwin32.sourceforge.net/packages/pngutils.htm pngutils for the Win32 console] *[http://www.neilturner.me.uk/2005/Feb/05/quickly_compress_png_images.html Quickly compress PNG images] - Add the crush option to the context menu of Windows Explorer.