The Visual Lounge lets you find out about TechSmith behind-the-scenes. Watch screencasts and videos from other customers, meet up with your fellow TechSmith users and staff, and get more tips and tricks!

RSS iconSubscribe to RSS feed

Not All PNG Compressors Are Created Equal

Posted on Thursday September 15, 2011 by Randall Brown

This week's Dev Corner post is brought to you by Eric Jensen.

Not All PNG Compressors Are Created Equal

Don't believe me? Here's two versions of a Jing logo from one of our press releases.

Jing.pngJing_optimized.png

So what's the difference? The image on the right is less than 1/2 the size of the original image on the left. If the PNG compressor doesn't optimize color depth, or uses non-aggressive DEFLATE compression it can produce PNG's that are up to 90% bloat.

Not just for the web

Optimizing the PNG's in the Camtasia Relay PC recorder resulted in a ~7% (302KB) file-size reduction.
"302KB... big-whoop, people have big hard drives now-a-days"

Touché. But know that file size isn't the only thing affected. With optimized PNG's, the Relay recorder's memory usage decreased ~6.5% (23,736KB vs. 25,268KB) and the start-up time decreased by ~5% (0.774 vs. 0.811 sec avg over 20 iterations). Keep in mind that the Relay recorders are relatively small apps and use a relatively small number of PNG's. Other, larger, applications may see more drastic results.

Producing optimized PNG's

In the case of the Jing logo, it looks like Photoshop is the culprit. When using Photoshop, always use "Save for Web & Devices..." rather than "Save As..." for the final image.

photoshop-save-web-menu.jpg

If you've already got a bunch of un-optimized PNG's, utilities like PNG Gauntlet help batch process them.

The sprite sheet dilemma

Sprites.png

Why did relay.sprite.3.1.png only get a 6% improvement while others got 70-80% improvements? Unfortunately, if even 1 out of 100 images requires 32bit color, the entire sprite sheet is required to use 32bit color. Thus, color depth optimizations are impossible in this case :-( . However, this does not mean that you should immediately slice up all your sprites. Sprites are still awesome at reducing file size and network requests. But, combining all images with varying color depths into a single sprite sheet might not be size-optimal.

Eric_Jensen.jpgEric Jensen has been working at TechSmith since graduating from Michigan State University in 2010. Eric is currently working on the Camtasia Relay team as a software engineer. He enjoys natural fractals, underwater hockey, and contributing to open source projects.

Comments (1)

Anton Bollen :

Excellent article, thanks for sharing. I suppose I should go and convert some old PNGs now...

Quote floater

Post a comment


Can't read image


Type the characters you see in the picture above.

Currently Reading:
“Not All PNG Compressors Are Created Equal”

This page contains a single entry from The Visual Lounge posted on September 15, 2011 2:00 PM.


Previous entry:
Video Marketing Made Simple from MarketingProfs University.

Next entry:
Boom! Coach's Eye and T-shirt Cannons.


All recent entries can be found on the main page or by looking through the archives.