Page 1 of 1

PNG Performance

Posted: 2008-03-17T19:21:25-07:00
by kilrae
I have a 700k 1280x800 PNG that I am resizing (testing) to 500x312.

I have tried scaleImage, resizeImage, thumbnailImage and sampleImage. I have tried setImageFormat('png') and setCompressionQuality(0) and (100).

The file is scaled, but the filesize remains around 6-700k (although one method I tried caused it to jump to over 900k).

I tested in GD and the resulting file was around 100k. JPEGs work fine, it's only PNG I'm having trouble with. Is there anything different I need to do to handle PNGs?

Re: PNG Performance

Posted: 2008-03-17T19:23:03-07:00
by magick
Set the image depth to 8. By default it is most likely creating a 16-bit PNG image.

Re: PNG Performance

Posted: 2008-03-18T14:08:28-07:00
by kilrae
Ahh, beautiful. 150k.

It seems odd to me that thumbnails would default to being created at a higher depth than the original image (getImageDepth tells me the original was 8bit).