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

后端 未结 13 1795
無奈伤痛
無奈伤痛 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:16

    There is a hack that can be done to use GIF images to show true color. One can prepare a GIF animation with 256 color paletted frames with 0 frame delay and set the animation to be shown only once. So, all frames could be shown at the same time. At the end, a true colored GIF image is rendered.

    Many software is capable of preparing such GIF images. However, the output file size is larger than a PNG file. It must be used if it is really necessary.

    Edit: As @mwfarnley mentioned, there might be hiccups. Still, there are still possible workarounds. One may see a working example here. The final rendered image looks like that:

    full-color-gif-image

提交回复
热议问题