Live data from Hacker News

JPG vs. PNG vs. GIF vs. SVG

uxdesign.cc

71–77 of 77 posts

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

#71
post #67
post #20

Is it a vector? Yes Is it a logo? No Result: GIF I can't even

Only if it's a vector image that's not for a website. The chart assumes only websites know how to handle SVG.

But why would you downgrade an SVG to a raster-only format...

The SVG is also probably lighter in file size too.

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

#72

Earlier quoted context omitted.

Also apng. Time to retire gifs already.

Hasn't apng been made obsolete by mp4 before it managed widespread adoption? Basically they were supposed to be easy like the old animated gifs, but developers dragged their heels on it so long that they forced people to adopt the full fat alternatives in the meantime.

apng also supports transparency while h.264 doesn't.

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

#73
post #61
post #14

Earlier quoted context omitted.

> 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

You are right, I tried creating a 16x16 image with 3 colors and despite my best attempts, the GIF came out to 93 bytes and the PNG 139 bytes. So there are cases where the GIF will be smaller than the PNG. On the other hand, if you are loading enough small PNGs for this to make a difference, perhaps any performance issues that come up might be helped by switching from PNG to GIF.

Sorry, that should read "might not be helped".

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

#74

Earlier quoted context omitted.

mp4 with fallback to gif doesn't make much sense. More appropriate would be webm, or in the future AV1 with a fallback of h264 mp4 for video or high quality animated images. Using gif for small animations is fine, especially if you have transparency.

mp4 is for efficiency, gif is for compatibility. if an mp4 doesn't play, a webm probably won't play either. you can do mp4 -> webm -> gif if needed, but that's extra encoding that probably isn't needed.

WebM will play in cases where MP4/h264 won't play due to missing patent-encumbered codecs.

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

#75

Earlier quoted context omitted.

mp4 is for efficiency, gif is for compatibility. if an mp4 doesn't play, a webm probably won't play either. you can do mp4 -> webm -> gif if needed, but that's extra encoding that probably isn't needed.

WebM will play in cases where MP4/h264 won't play due to missing patent-encumbered codecs.

That's not a big real world issue though, but yeah if you want to provide 100% compatibility it would help a little. It's hard to justify the extra (less efficient & slower) encoding to support those few edge cases.

h.264 gives you good performance, hardware encoders/decoders, best compatibility. Most of the time just using it alone is the best value.

All that depends on how many videos you need to transcode though. If you just have a few, do all the main codecs.

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

#76
post #71
post #67

Earlier quoted context omitted.

Only if it's a vector image that's not for a website. The chart assumes only websites know how to handle SVG.

But why would you downgrade an SVG to a raster-only format... The SVG is also probably lighter in file size too.

Beats me. Well, unless it's for a platform that doesn't support SVG of course, but what doesn't support SVG these days?

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

#77
post #46

Earlier quoted context omitted.

Works fine with NoScript and everything blacklisted. Firefox 66.0.4 for Fedora

It'll work without Javascript if you already have the image cached.

Sorry for the late reply, but I just tried a clear cache+refresh and it still loads the image fine.
Post reply on HN