Smaller PNG filesizes

Guides By 4 years ago

This is a real world iOS example, but can be applied to PNGs in any scenario.

In iOS the splash screen images have to be PNGs. This works great for simple images with just a few colors, but will result in huge PNGs if you plan on having photo content, especially on the retina iPad with a screen resolution of 2048×1536.

At first I figured because PNGs are lossless that there’d be very few ways to reduce the filesize. I am going to run through the well known ways and some others that were new to me.

ImageOptim

I have previously written about using ImageOptim to make images small, but on photo content it doesn’t help much – our retina iPad images were 5mb each, and you need one for portrait and another for landscape.

8 bit

Obvious but effective. Export your PNGs with 8 bit color instead of 24 and the filesize is reduced drastically. Of course, there wont be nearly as many colors to make up your image so if you have tons of colors then there will be dithering to make up for it.

PNG from a JPEG

If you convert your PNG to a JPEG with some compression, then back to a PNG you can save a lot in terms of filesize.