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…
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
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.
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.
I ended up using ImageOptim:
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.
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:
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.
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.
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.
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).
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.