For the image title of my website medium-small(150x50) white background with some effects on title (example: google title image)

I saved the image in .gif and .png with result:

.gif size = 3.09 kB .png size = 7.59 kB

The .png is 2x bigger than .gif.

Everyone are saying me to use .PNG, but why I should use it if .gif are better

5 Answers 5


PNG almost always gives better compression than GIF, but you need to make sure you're saving the image as an 8-bit PNG. Often graphics programs will save as a 24-bit PNG, which may be why you're seeing the results you are. If you say what program you are using we may be able to advise how to save as an 8-bit PNG.

You can also run the resulting file through either pngout or pngcrush which will reduce the file size even further.

Really the only reason to use GIF over PNG these days is if you need animation.

  • saved in 8-bit png with photshop -> save for file and devices, now png is 3.72 kB, still the .gif is less
    – dynamic
    Commented Mar 10, 2011 at 22:52
  • @yes123: are you able to post a link to the image file? I'm curious now Commented Mar 10, 2011 at 23:20
  • 1
    Photoshop creates bigger file. One can also use the combination of OptiPNG and AdvPNG to optimize file size.
    – lulalala
    Commented Sep 1, 2011 at 2:10
  • Run your PNGs through this tool: people.bath.ac.uk/ea2aced/tech/png/pngslim.zip.... Incredibly slow to the point you thing the application crashed on you, but incredibly amazing compression results ...
    – David K.
    Commented Apr 23, 2012 at 9:51

Apparently png either matches or gets better compression then gif. Try using these tools. The first is from yahoo the 2nd i think i heard about more then once.


Use the format that works best for you. Each format has its strengths and weaknesses but when multiple formats offer you the same image quality then let size be the determining factor. In this case GIF wins. Just keep in mind this won't always be the case so you should always check to see which one suits the current image best and don't lock yourself into one format just because it was better that one time.


PNG images allow for Alpha and GIF images do not. So if you have any fading effects where you want the background to be seen through your image then you want to go with PNG.

Also, PNG images with alpha require extra CSS coding in order to appear correctly if they have alpha.


If you want to be nice to IE6 (or heaven forbid earlier) and not worry about png fixes I would use gif. But then who wants to be nice to IE6 any more? :)

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.