8

I'm trying more and more to get by sans PhotoShop for my personal/freelance work. I do primarily web work these days and don't do enough side gigs to justify keeping up with the Creative Suite beast.

Alas, that does bring to the table some limitations. On OSX I've been enjoying Pixelmator but it has woefully inadequate PNG export support. I can dump it out as a PNG then use one of the many great PNG optimizers like PNGCrusher and can reduce the size fairly well.

Alas, all of the PNG optimizing tools I've found are purely lossless.

Is anyone familiar with a tool (other than PhotoShop) that would offer up some lossy PNG compression options as well like reducing the color pallet, converting 32bit to 24 or 8bit, etc?

Addendum: I'm open to OSX or Windows software. I could even fire up Ubuntu if I had to, I suppose...

9 Answers 9

4

There were some good answers to this png compression question on SU. One or more of those might well fit the bill.

Irfanview has excellent png support in its PNGOUT plug-in, and it's free for non-commercial use. It's been a while since I played with it, but iirc it did include lossy (color table) compression.

That said, I'm fairly certain png output in Photoshop hasn't changed since roughly the end of the last Ice Age, and I don't see any signs of it changing any time soon, so if you have any version of PS its png capabilities won't be outdated.

And all that said, this is all about bandwidth. But bandwidth is fast becoming a non-issue, and in parallel with that the importance of image super-compression, minified code and all the other optimization tricks that have exercised the webdev community for years is fading rapidly. Even for mobile broadband devices, bandwidth won't be a concern for 95% of users within the next two to three years.

4
  • 1
    I wish the bandwidth issue was going away. I agree it's less of a concern, which is nice, alas, I think you may be a bit optimistic on the mobile space (as much as I wish it were true). Even with my iPhone, I wouldn't say it's speedy over 3G in many areas. ;) Thanks for the link. I'll peruse the options there. I should also try Irfanview. It's always something people rave about but for whatever reason, I never got around to trying it.
    – DA01
    Nov 11, 2011 at 1:08
  • Oh, I'm the perennial optimist! But it's what, 3 years since Edge was the fastest mobile game in town? Now we have WiMAX. LTE is coming up very fast, and it's planned for the iPhone 5. I can still recall the thrill of my first 1200 bps modem -- $300, but 4x the speed! Whoopee! The US is wa-a-a-y behind the rest of the world on broadband, but even here 56k dial-up became the minority quite a while back. Images and code efficiency stopped being a big deal with DSL, but we still tend to think in terms of a 56k Internet. Nov 11, 2011 at 4:37
  • also imagemagick is open source and has binaries for win, osx, ios and linux. Once you go lossy, why not jpeg? What impact does lossy compression have on alpha transparency?
    – horatio
    Nov 11, 2011 at 18:00
  • My mobile dongle in the UK often gets 16-32 kbps on the train, although theoretically 3G capable. Bandwidth problems are not going away for mobile users.
    – qris
    May 28, 2013 at 13:40
4

The one I like is called pngnq. It gives pretty good dithering, and one really really nice feature is that it lets you preserve the 8-bit alpha channel rather than quantising it to 1-bit (remember the bad ol' days of GIF?). It's command-line only, but if you don't mind that, it'll be a handy tool in your arsenal.

You can choose to dither or not, of course -- sometimes the file size of the quantised PNG is larger than the original RGBA, so you may have to play around with dithering settings to get something that works.

2
  • Paul, a very, very belated 'thanks!'. This looks like a nice option for going down to 256 colors.
    – DA01
    Jun 10, 2012 at 1:10
  • You're welcome! After having used it for a while, I have to say I quite like pngnq. It has very few command-line configuration options, and it never overwrites the original file unless it explicitly tells you to. So you can always delete the new file if it looks ugly or is larger than the original -- quite useful for a command-line program that doesn't have a preview window :-) Jun 11, 2012 at 13:48
3

I ended up using ImageOptim:

http://imageoptim.com/

What it is is a wrapper around several different PNG optimization tools. It comes with OptiPNG, PNGCrush, AdvPNG, PNGout and a few other's you can add-on.

The idea is that it picks the best tool for the particular PNG.

It's not perfect in that it's still mostly automatic, so I can't fine tune more lossy options. Alas, Pixelmator is still woefully lacking in PNG export options so, for now, this is what I'll use.

0
3

I've found 3 different methods for lossy PNG (lossy averaging filter, vector quantization, median cut posterization) and implemented them in ImageAlpha. That's a Mac application, but tools for individual techniques are available for other platforms.

Description and examples:

http://pngmini.com/lossypng.html

Lossy PNG with alpha

1
  • 1
    I just discovered ImageAlpha and am loving it! It takes away pretty much the only reason I ever used Fireworks :) I was going to share the resource on this site but I see you already did. So, just commenting to affirm the usefulness of this answer.
    – Brendan
    Mar 13, 2014 at 14:14
2

Image Analyzer has the ability save lossy PNGs while preserving the alpha layer. It starts to lose quality from the original image about the same way a JPEG does, but unfortunately at a much faster rate. Still, for photographs with an alpha layer, it does the trick and saves some bytes. I would love to see this idea extended further, or see JPEG 2000 (which I believe supports alpha channels) garner some browser support.

1
2

By the maker of ImageOptim is ImageAlpha which is a lossy png optimizer, http://pngmini.com/ It will convert your 32bit png into 16bit color or less.

1

There's a free online service at tinypng.org that performs pretty advanced lossy compression. It quantises the image so it only needs 256 colours, and then stores the file as 8-bit indexed PNG. It also preserves full alpha transparency. It performs additional compression of the resulting PNG file, something that other quantisers such as pngnq don't do.

0

Another option (for Windows users) is PNGSlim. There's a nice write-up on it at this guy's blog:

The program is essentially a batch optimizer of PNG images using PNGREWRITE, OptiPNG, PNGOUT, AdvDEF and DeflOpt to minimize file sizes.

I'm not sure all the technical specs of each of the optimizers it uses, but I use it regularly and it logs messages about optimizing pallets (and I believe the bit depth, but I'm not positive on that).

0

I tend to use SmushIt. It's just a personal preference 'cause I don't need any installed tools and can access it anywhere as it's a webservice. It also automagically converts GIF images to a PNG if it sees that a PNG is the more efficient route.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.