How to compress a huge amount of PNG images?

7

2

At work, on certain projects I have to manage a lot of images. Most of the time PNG files work the best for what I'm doing.

With such a huge amount of images, I've tried using PNG compression with PNG Gauntlet but sometimes the file doesn't really change and sometimes PNG Gauntlet reports it would've made the filesize bigger!

Am I just maxing out the compression or is there something more I can do?

Travis

Posted 2009-07-15T15:42:17.790

Reputation: 2 125

Answers

15

PNG compression is a lossless compression. However, a caveat to this is that there will be times when compressing an image will not always yield the results you want (% compression ratio won't be that great). In contrast to lossful compression (like JPG compression), where you will almost always get a filesize reduction (% compression ratio might be higher), but you actually lose image quality.

Joseph

Posted 2009-07-15T15:42:17.790

Reputation: 852

11

Have you tried PNG Crush?

raspi

Posted 2009-07-15T15:42:17.790

Reputation: 911

6

PNG compression works better for images that have large areas of flat color, like cartoons that are colored with simple color fill, as apposed to a painting which has many colors which look similar, but really aren't.

Brad Gilbert

Posted 2009-07-15T15:42:17.790

Reputation: 771

4

You should check if you PNG files do really need all the features PNG offers. If it doesn't have man colors, maybe you should switch from 24-bit color to a colortable? If you don't use alpha channel, turn it off. This can make them much smaller.

liori

Posted 2009-07-15T15:42:17.790

Reputation: 3 044

4

I recommend PNGOUT - it works very well. I have never had it make a file larger, and have only had it keep the same file size on rare occasions.

via Coding Horror

Cristián Romo

Posted 2009-07-15T15:42:17.790

Reputation: 525

2PNG Gauntlet is a GUI for using PNGOUT – Sam Hasler – 2009-07-16T12:06:42.163

+1 for the Coding Horror link. great article there. – Lazer – 2009-09-23T10:08:37.387

4

You can try all of the PNG compressors at once, e.g. ImageOptim for OS X does that, and that's best you can get with lossless PNG alone.

However, there are lossy operations you can do to make PNG smaller (easier to compress).

If you have 24 bit PNG with alpha channel, convert it to paletted PNG with 8-bit alpha channel. pngquant does that (sadly both Photoshop and GIMP pretend such combination cannot exist).

Kornel

Posted 2009-07-15T15:42:17.790

Reputation: 1 225

3

Your best bet would be to use Optipng, there are links to GUIs projects for it on their homepage if you need one. The way it works is very efficient size-wise, by trying every combination of compression parameters you have a guarantee to find the better one.

The drawback is that it will consume more cpu than other techniques because it compresses the same image multiple times to find the smallest one, without any assumption.

The cool factor here is that you can adjust the optimization level to spare CPU time at your convenience (-o level), in that case assumptions will be made but generally you will not gain anything at testing every possibility.

Shadok

Posted 2009-07-15T15:42:17.790

Reputation: 3 760

0

I have used PNGOptimizer for years! Never had a problem with it. https://psydk.org/pngoptimizer

Ghosted

Posted 2009-07-15T15:42:17.790

Reputation: 11

0

I know this is an old post but I came across it looking for a PNG Optimizer of some sort.

I found this: PngOptimizer it has a nice interface and I ran 61 files at once, it took about 30 seconds. The 61 files were originally 360kb and it compressed them to 300kb.

Some files it changed the files only 2 or 3 percent of the original others it reduced by 89%!

One Note: I never saw it make a larger file. It would say File 100% og original but never larger =>

It does vary though. Try it and test it for yourself =>

L84

Posted 2009-07-15T15:42:17.790

Reputation: 3 403

-1

Use tinypng.org.

This thing converted my 3 MB image to a 300 KB one. It's amazing!

ninad

Posted 2009-07-15T15:42:17.790

Reputation: 1