Web Colors.
PNG overview

PNG compression

Test image - 24 bit PNG format

Paul Schmidt, a member of the PNG Development Group, created a test image made up of 256 blocks containing color gradients. In the first block the green component is zero. It gets incremented for each new block until it ends up at 255. The dimensions of the image are 4096 x 4096 pixels ( 16.7 million colors ). Uncompressed, the file size is 48 megabytes. The original image came down to 58.4 kbytes in PNG format. The compression factor worked out at 841:1. It is even possible to compress it down to 875:1 by using the PNGOUT compression utility reviewed on the PNG image tools page.

PNG is the best format for true color images of this type. GIF format is not a contender because it can only handle 256 colors. JPEG is better for photos and scans, but not for images containing sharp transitions.


The screenshot image was prepared in stages. First, it was reduced in size. Then the test image within the browser frame was cut from the screenshot and the number of colors in the frame reduced to 8. Finally, the test image was re-inserted into the frame. The resulting 24 bit PNG image contains 33,509 colors. Its file size is 1561 bytes, which is not possible with JPEG format.

Thumbnail impression

To provide an overall impression of Paul Schmidt's test image, it was resized to 256 x 256 pixels, which reduced the number of colors to 65,536. Using the highest PNG compression setting, the file size came down to 678 bytes.

Block #1

Here are two illustrations of the first block in the test image. The first is a 24 bit PNG image. Its file size is 570 bytes. The second is a JPEG image using a 75% quality setting. Its file size is 2132 bytes. These images will have a patterned appearance in 16 bit or 8 bit color mode. True Color mode is required for gradients to look smooth, whatever image format is used.

PNG image - 24-bit color - 570 bytes. JPEG image - 24-bit color - 75% quality - 2132 bytes.

Archived test image

If you would like to view the original test image, it is archived at the PNG Home Site. The decompressed image will occupy 48 MB of RAM.

Screenshot of Paul Schmidts test image.

Metrics for the test image.

Thumbnail impression of the test image :24-bit color - 678 bytes.

The tables below show compression results for three image converters. JPEGs are included for comparison.