By using this site you agree to the use of cookies by Brugbart and our partners.

Learn more


About the PNG raster graphics file format.

Edited: 2015-09-04 22:55

The Portable Network Graphics PNG file format is a raster graphics file format that is mostly used to store computer created graphics. Its lossless and relatively high compression makes it a popular format, especially for internet use.

For photographs JPEG will typically allow for a better compression than PNG. Wheres saving a photo as PNG will typically result in a increase in file-size, with almost no gain in quality. PNG is therefor mainly recommended for graphics with a lot of sharp transitions, such as icons, text and GUI elements.

Care must be taken when deciding whether to save as PNG8, PNG24 or PNG32. Generally, if alpha transparency is needed, one must save as PNG32. The difference between PNG8 and PNG24 is that PNG8 is only 256 color, and PNG24 is 16bit, and not 24bit as it's name suggests. Both PNG8 and PNG24 only supports binary transparency, and PNG32 is really just 16bit with an extra 8bit used for partial transparency, also known as alpha transparency.

PNG generally offers lower file sizes than the GIF format, and was originally created as a patent-free alternative to GIF, the patents on the GIF format has since expired however.

The mime type of PNG is:


Optimizing and compressing PNG files

Tools exists to optimize and compress PNG files, some of these tools may offer better compression that commercial software such as Adobe Photoshop.

The compression done by free software such as Gimp or Paint.NET is also fairly good, but sometimes better results may still be achievable with tools such as pngcrush or PNGOUT.

As a lot of the PNG optimizers are command line tools, one may wish to download a GUI, one such is Trimage

Do not pay money for an optimizer or compression tool, as the free alternatives are most likely just as good. There are also websites offering to compress your images freely.