What are the different usecases of PNG vs. GIF vs. JPEG vs. SVG?

后端 未结 13 1792
無奈伤痛
無奈伤痛 2020-11-22 11:28

When should certain image file types be used when building websites or interfaces, etc?

What are their points of strength and weakness?

I know that PNG &

13条回答
  •  孤街浪徒
    2020-11-22 12:29

    The main difference is GIF is patented and a bit more widely supported. PNG is an open specification and alpha transparency is not supported in IE6. Support was improved in IE7, but not completely fixed.

    As far as file sizes go, GIF has a smaller default color pallet, so they tend to be smaller file sizes at first glance. PNG files have a larger default pallet, however you can shrink their color pallet so that, when you do, they result in a smaller file size than GIF. The issue again is that this feature isn't as supported in Internet Explorer.

    Also, because PNGs can support alpha transparency, they're the only option if you want a variation of transparency other than binary transparency.

提交回复
热议问题