PNG Compression and Optimization
PNG file format provides an effective algorithm (LZ) for lossless image compression. It supports true color (PNG-24) and palletized (PNG-8) images with optional information about transparency (alpha channel).
VIMAS Technologies supports PNG file format in image optimization application Web Image Guru Suite and in software development kit VIMAS Imaging SDK. Below briefly described PNG optimization parameters available in these VIMAS products.
1. PNG-24 optimization.
PNG-24 is a useful image file format for high quality lossless image archiving, when required maximum quality or full alpha channel support. Because of good compression algorithm which often outperform methods specified in the newest JPEG2000 image compression standard (in lossless mode, of course). Web Image Guru plug-in has implementation of PNG-24 image compression algorithm that usually produces optimized files with smaller size than ones created by popular image editors (See example on Fig.1). It has also unique ability to reduce number of colors in PNG-24 image to improve its compressibility. This feature especially useful for images with full alpha channel when file size is important, for example in Macromedia Flash movies.

Fig.1 , PNG-24 image, 12409 Colors
|
Web Image Guru - 30.7 K
Adobe Photoshop CS - 32.1 K
JASC Paint Shop Pro 8 - 32.1 K
Macromedia Fireworks MX 2004 - 30.9 K
|
2. Color reduction for PNG-8 optimization.
PNG-8 images may contain 256 or less colors. This feature lets greatly reduce file size. The smaller number of colors in image - the smaller its file size and the higher visible artifacts on it (Compare images on Fig.2 and Fig.3). VIMAS Technologies offers extremely effective color reduction algorithm that outperform most known popular programs. It produces consistent results even for 16 colors images. In addition VIMAS color reduction algorithm has such advanced optimization features (described below) as tunable dither level and area weighting of control parameters.

Fig.2 Web Image Guru PNG-8
File size 10.2 K, 256 Colors
|

Fig.3 Web Image Guru PNG-8
File size 3.75 K, 32 Colors
|
3. Dithering.
As you may see from Fig.4 color reduction on smooth image areas cause banding that drastically affect image quality. To reduce it should be used dithering, which spatially mix adjacent colors to simulate removed colors. Unfortunately dithering may lead to increased file size, false colors and structured noise. Dithered image from Fig.5 created by Web Image Guru has much smoother color transitions, which is more pleasured for human eye.

Fig.4 Web Image Guru PNG-8
File size 3.75 K, 32 Colors,
Dither 0
|

Fig.5 Web Image Guru PNG-8
File size 5.1 K, 32 Colors,
Dither 7
|
4. Weighted PNG-8 optimization.
PNG-8 weighted optimization lets you improve quality (reduce compression ratio) only for the important masked regions. This technique produces higher-quality results in critical image areas without sacrificing file size. Fig.6 shows image from Fig.5. Image on Fig.7 has an emphasized top-right area. Banding is greatly reduced on the blue planet and on gradient around it. This image is comparable with one from Fig.2 that has 256 colors!

Fig.6 Web Image Guru PNG-8
File size 5.1 K, 32 Colors,
Dither 7
|

Fig.7 Web Image Guru PNG-8
File size 4.7 K, 32 Colors,
Dither 7
|
5. Alpha Dithering.
PNG-8 files may contain only fully transparent and fully opaque pixels; therefore Alpha Dithering is used to simulate partial transparency. As you may see from images below (created by Web Image Guru), alpha dithering significantly improve image appearance over unspecified background. Image from Fig.11 has much smoother transition from blue to brown, than one displayed on Fig.10.

Fig.8 No alpha dithering
Predefined black background
|

Fig.9 Alpha dithering 8
Predefined black background
|

Fig.10 No alpha dithering
New background
|

Fig.11 Alpha dithering 8
New background
|
6. PNG-8 alpha transparency (palette alpha)
Web Image Guru supports index color (or palette) images containing alpha values. This feature available only for PNG-8 images and has name Palette Alpha or in some other programs Alpha Transparency. It is very useful if you need to make some image composition. Web Image Guru allows manual editing of color and alpha values in palette. It also supports external palettes with alpha values in Microsoft pal format to use one palette for several images. Here you can compare images with palette alpha generated by Web Image Guru and Macromedia Fireworks MX 2004 . Original image may be downloaded from here. PNG-8 with palette alpha does not supported by Microsoft Internet Explorer, therefore actually you see screen shots from Image Guider, but all images linked to actual PNG-8 files, which may be downloaded by right-mouse click or opened in Mozilla family browsers.

Fig.12 Image with 16 partially transparent
colors created by Macromedia Fireworks
|

Fig.13 Image with 16 partially transparent
colors created by Web Image Guru
|
VIMAS image processing technologies:
|