Live data from Hacker News

JPG vs. PNG vs. GIF vs. SVG

uxdesign.cc

11–20 of 77 posts

Re: JPG vs. PNG vs. GIF vs. SVG

#14
post #6

This chart offers some dubious suggestions, even ignoring the "Burn it with fire" bit. Unfortunately, it doesn't explain any of its reasoning. A photograph that's not real big is probably still better suited for JPG. And there's no reason to use GIF for any still image - PNG will be superior in all situations. A moving image may be better off as an MP4 for modern browsers in terms of file size and quality, but there'…

> there's no reason to use GIF for any still image - PNG will be superior in all situations

For small icons with few colors, I find GIFs to be consistently smaller than PNGs.

For example, my website's favicon:

    http://alexvh.me/favicon.gif     216 bytes

    http://alexvh.me/favicon.png    1041 bytes

Re: JPG vs. PNG vs. GIF vs. SVG

#15
Why use a chart? It's what, four questions?

Is it a vector image? -> Use .svg

Is it an illustration (bitmap) with transparency (i.e. a cutout of a man) -> Use .png

Is it animated? -> Use .mp4 and fallback to .gif

Is it a photo? -> Use .jpg and compress as much as possible

Re: JPG vs. PNG vs. GIF vs. SVG

#17

Why use a chart? It's what, four questions? Is it a vector image? -> Use .svg Is it an illustration (bitmap) with transparency (i.e. a cutout of a man) -> Use .png Is it animated? -> Use .mp4 and fallback to .gif Is it a photo? -> Use .jpg and compress as much as possible

Oh yes. Especially, never ever loose vector information if available. Vectors can scale. Bitmaps cannot. The chart gets this plain wrong.

Re: JPG vs. PNG vs. GIF vs. SVG

#19
post #14
post #6

This chart offers some dubious suggestions, even ignoring the "Burn it with fire" bit. Unfortunately, it doesn't explain any of its reasoning. A photograph that's not real big is probably still better suited for JPG. And there's no reason to use GIF for any still image - PNG will be superior in all situations. A moving image may be better off as an MP4 for modern browsers in terms of file size and quality, but there'…

> there's no reason to use GIF for any still image - PNG will be superior in all situations For small icons with few colors, I find GIFs to be consistently smaller than PNGs. For example, my website's favicon: http://alexvh.me/favicon.gif 216 bytes http://alexvh.me/favicon.png 1041 bytes

One of the problems with PNG is that many applications default to full-color-with-alpha-channel as the only save method, even though PNGs can do paletted images just as well as GIF and end up basically the same size. So people look at their PNG files and wonder why they are so big compared to the old GIFs because their application sucks.

Edit: I just tried it with your example:

% giftopnm favicon.gif | pnmtopng > favicon.png

pnmtopng: 5 colors found

% ls -l

-rw-r--r-- 1 jandrese jandrese 216 Aug 7 17:33 favicon.gif

-rw-r--r-- 1 jandrese jandrese 255 Aug 7 17:33 favicon.png

Post reply on HN