PNG vs GIF for 1 bit transparency

Is there any reason for using GIF instead of PNG when the image requires only 1 bit transparency (either on or off) and of course no animation is required?



No, GIF for static images is a waste of bandwith. PNG can almost always be much smaller than GIF

  • GIF has a very poor compression algorithm, but has a smaller header.

  • PNG has a few bytes more of overhead for extensible metadata, but has a superior compression algorithm.

So the larger the image, the bigger advantage PNG has. Basically only images like 1×1 spacer are going to be smaller in GIF.

It doesn’t matter whether image has transparency or not — in every case PNG can compress pixels better.

However, there are programs that don’t fully take advantage of PNGs compression capabilities and Photoshop is one of them.

You can fix Photoshop’s poor PNG compression with a PNG optimizer such as PNGOUT or ImageOptim.

Source : Link , Question Author : cherouvim , Answer Author : Kornel

Leave a Comment