X
Business

PNG format shows superb lossless compression

Blogger David Naylor managed to get himself dugg for posting this cool 24-bit bitmap that shows every single color in the 24 bit spectrum.  The file is 4094 by 4096 pixels which works out to precisely 16,777,216 pixels which happens to be 2 to the 24 bit power.
Written by George Ou, Contributor

Blogger David Naylor managed to get himself dugg for posting this cool 24-bit bitmap that shows every single color in the 24 bit spectrum.  The file is 4094 by 4096 pixels which works out to precisely 16,777,216 pixels which happens to be 2 to the 24 bit power.  What's interesting is that such a file takes 48 MBs to store in an uncompressed format yet the PNG compressed file took a mere 58 kilobytes which means PNG compression achieved a 847.5 to 1 LOSSLESS compression ratio!  The same file in a minimum-loss JPEG compressed file took 3.84 MBs and this is NOT a lossless format.

The moral of the story is that people need to be more aware of the PNG format and stop using JPEG for everything.  The worst thing people can do is use JPEG for screenshots because the results are often worse than PNG yet the file size is larger.  JPEG is more appropriate for Internet distribution of medium and large sized photos of nature or people where you need a good compression ratio with an acceptable loss in image quality.  PNG format may still be useful for smaller images where the file isn't that big to begin with.

Some people might ask me what about the GIF lossless format.  GIF files are perfectly fine if all you need is 256 colors.  The PNG format supports 16.8 million colors and is just as universally supported as the JPEG and GIF format.

Editorial standards