Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't know why the animated gif seems as popular as ever, I can't think of any positives about it... bad colours, large file sizes and are encoders more readily available than proper video encoders? Also, supporting it fully now requires either threading or an event loop. The value isn't worth the complexity.


Partly because of how they're presented to the user. You send a video, there's usually a play button, a bit of a delay to load, and sound. Gifs play automatically, first frame loads with barely any pause, and there's no sound ever. So, they present two different use cases, which, at the end of the day, have nothing to do with the format itself. But it can show that to humans, often the ends matter, not the means.


It's also a UI issue. On most OSs I can copy/paste an image like it was text. And a gif counts as an image so I can copy/paste images without having to save them. And since many modern UIs are hostile to saving videos, its the difference between holding and copying vs having to take a screen recording or finding a video download website to rip it.


It's really too bad that browsers did not add support for silent auto-playing looping videos to <img>.


They usually work where jpg and png images work too, most importantly in most places where you render Markdown. No matter how more efficient a real video file would be, often a short gif right there in the README.md is the perfect way to convey a piece of information.


It's still a reasonable format for its original use - images with large areas of solid color where only a small percentage of pixels change across a small number of frames.

If your animation has <256 colors then it's even lossless, something not possible with any of the video codecs.


H.264, H.265, VP9, and AV1 all support losless encoding (regardless of color count).

Webp is the more literal replacement for the GIF use case though and also has no color limitations in the lossless animation mode.


>something not possible with any of the video codecs

Which codecs? You can have eg. lossless H264 just fine.


Lossless h264 requires 4:4:4 chroma, which is allowed by the spec but not supported by many consumer playback methods. (QuickTime Player, for example, only supports the yuv420p pixel format.)


It is part of the High 4:4:4 Predictive profile, but you can use it with 4:2:0 subsampling if you want. It's more accurate that the all profiles H.264 defined kinda sucked except for Main, and no one really thought 10bit, 422 or especially 444 were useful and completely ignored those profiles until it was too late to be worth implementing.

Actually, lossless video is also rather marginally useful, especially given the decode cost of the arithmetic coding H.264/HEVC/VP9/AV1 have.

Ironically for your example, lossless, 4:4:4, and 10bit H.264 actually will play back on the new M1 Macs in QuickTime Player, though with a warning about it.


Are they though? If I remember correctly, most "gif" sites online serve webp...


For the user the proposition is the opposite. The value of the technically superior formats isn't worth the increased use complexity.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: