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?


  • 1
    GIFs are more limited in what they can do (excluding animation vs PNG) but they take up less space. If you're just using simple images, and you'd want to eliminate just one color (like a white background) a GIF will save you space. But for more advanced transparency, use a PNG.
    – Hanna
    Mar 12, 2011 at 21:35
  • GIF is better supported in older browsers.
    – horatio
    Mar 15, 2011 at 14:25
  • 2
    @horatio: Even IE6 supports PNGs with 1-bit transparency.
    – e100
    Mar 17, 2011 at 13:30

4 Answers 4


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 1x1 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.

  • 2
    and as you pointed out in another thread elsewhere, png-8 supports alpha transparency with a graceful fall back. This is a huge win over gif.
    – horatio
    Mar 5, 2013 at 16:53

PNG is similar to GIF in many ways but even better in others. It is lossless like GIF but supports 8 and 24 bit color, unlike GIF which only supports 8. PNG supports one-color and alpha transparency, whereas GIF only supports one-color transparency. PNG uses various compression filters to minimize overall image size and can apply different filters on a per-line basis to achieve higher compression. The big attraction to PNGs is its ability to do alpha transparency.

They both work better with large lines of the same pattern or color.

So no great difference for 1 bit transparency whether you use gif or png.

  • The size of a PNG will always be a bit bigger than GIF.
    – Joris
    Mar 12, 2011 at 14:30
  • 2
    @Joris This depends entirely on the application/algorithm that is being used. There are some tools that are able to compress png resulting in more compressed images. I once had such a tool.. It was command-line based and ran only in linux but the compression was awesome. pngs were between 1/3 and 1/4 less in size than their gif counterpart.
    – leugim
    Mar 13, 2011 at 6:46
  • when the image require only 1 bit transparency the size will affect only in bit kb's.so it depends on image if it have more detail png will be bigger then GIF.
    – Jack
    Mar 14, 2011 at 4:42
  • 2
    @Joris: PNG supports 1-bit color key, just like GIF, and the DEFLATE algorithm and various pre-filters applied to PNG is generally superior to LZW, so the assertion that PNG is always be bigger than GIF is dubious. When you're storing the same image (not a full color PNG vs jittered GIF) and you use a good PNG compressor (not Photoshop's or Paint's), it's very rare for GIF to beat PNG.
    – Lie Ryan
    Mar 5, 2013 at 11:35

If you're worried about size, GIF tends to be a bit smaller (it depends, of course).

Although, I prefer PNGs because of their versatility. I like to keep it consistent, so all my (static raster) images are in PNG.


GIF is a smaller size than PNG. I hate GIF personally because I use larger bit transparency. Hope this is the answer to your question.

  • Is it? If I save for the web appropriately I can achieve the same size more or less.
    – cherouvim
    Mar 12, 2011 at 10:49
  • Normally GIF files are smaller than PNG. But again, I recommend PNG because you can have much higher detailed images with it.
    – Joris
    Mar 12, 2011 at 15:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.