Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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

share|improve this question
add comment

5 Answers

up vote 10 down vote accepted

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.

share|improve this answer
    
saved in 8-bit png with photshop -> save for file and devices, now png is 3.72 kB, still the .gif is less –  dynamic Mar 10 '11 at 22:52
    
+1 especially the8bit png part. Thats how i suspect my images get most of its savings via smushit/pngcrush –  acidzombie24 Mar 10 '11 at 22:54
    
@yes123: I'm curious, how did smushit.com/ysmush.it do? If it is not as small i may want to find tools that either compress it better or to check if going with gif is better –  acidzombie24 Mar 10 '11 at 22:56
    
@yes123: are you able to post a link to the image file? I'm curious now –  Tim Fountain Mar 10 '11 at 23:20
1  
Photoshop creates bigger file. One can also use the combination of OptiPNG and AdvPNG to optimize file size. –  lulalala Sep 1 '11 at 2:10
show 1 more comment

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

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? :)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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