If the input file format is GIF or PNG we should be outputting to 8-bit PNGs to save a _lot_ of file size and bandwidth. With imagemagick this is pretty straightforward just use the following as the output filename
png8:file.png

I wasn't quite sure where to do this though. The module is a bit undocumented.

CommentFileSizeAuthor
#3 906320.diff986 bytesdalin
#2 906320.diff1008 bytesdalin
#1 910724.diff864 bytesdalin

Comments

dalin’s picture

Title: Web performance - user PNG 8bit where possible » Web performance - use PNG 8bit where possible
StatusFileSize
new864 bytes

This patch shows how it could be done, and it basically works. However you quickly see a big limitation in the way that ImageAPI currently works - it can't alter the destination filename. So we can convert a GIF to an 8bit PNG, but we can't change the file extension to match.

dalin’s picture

StatusFileSize
new1008 bytes

Errr, here's the correct patch file.

dalin’s picture

Status: Active » Needs review
StatusFileSize
new986 bytes

Perhaps since we can't operate on GIFs without breaking the API, perhaps we should just work on PNGs.

dalin’s picture

Also I just discovered this:
http://drupal.org/project/imageapi_optimize

drewish’s picture

Seems like this should be optional right? My understanding is that 8-bit PNGs don't handle transparency the same way.

dalin’s picture

Status: Needs review » Closed (won't fix)

I think the image optimization libraries that imageapi_optimize uses will do a far better job. Lets not re-invent the wheel.