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

Yes, video codecs are way better at generating smaller file sizes. GIFs are literally like flip-books of images.

You can also autoplay videos without controls and loop them, but you have to mute them.

Most "GIF" hosting websites actually use videos. Especially when it's "GIFs with sound".



That's actually not correct, GIFs can encode the differences between frames and quite efficiently for screen recordings. A GIF will be more efficient for a screen recording so long as there are small changes between frames.


Real video codecs do temporal compression too, and considerably better than GIF.

The situations where GIF can be smaller or more efficient than real video codecs are generally esoteric, to the point where I’m happy to say that no one should ever use GIFs for block-level graphics.


Oh, interesting. So it does some encoding, but not very efficiently?


Yes, in the GIF format you can update just a window inside the image rather than the whole image for each frame. There are also control blocks that specify that a particular colour value is to be treated as transparent (within the logical image) and that the background image should be restored after the window is drawn.

So for example a moving pointer can be very efficient if the encoder is able to take advantage of all these features.

A better encoder can take the images from the article down by a lot (I got 80% reduction with minimal reduction in quality using https://compress-or-die.com).


Every major video codec does this exact thing. Can you please stop spreading this misinformation all over the thread?


I don't believe I have made any factually incorrect statements, but please enlighten me if I have.

Have a look at the following two encodings of the same screen recording from the article, compressed to the same file size and the same framerate: https://tempklasjdf.s3.eu-west-2.amazonaws.com/most-engaging... https://tempklasjdf.s3.eu-west-2.amazonaws.com/most-engaging...

To my eyes the GIF version preserves a little more of the sharpness of the text but there's not much between them. And GIFs are simple and intrinsically support looping.

As an aside, there is currently a proposal to bring some features from GIF (and a few additional ones) to HEVC to better support screen recordings: https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.71...

Colour palettes and efficient spatial (rather than frequency domain) coding are being considered, both features of GIFs. Also support for RGB colour space rather than YUV420 to better preserve the colours (just like GIF!).


> Most "GIF" hosting websites actually use images.

I think you’re mistaken - I think they mostly actually use videos these days and ‘GIF’ refers to short and small videos generally, not the specific file format.


You're right. I meant to say "videos", fixed it.




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

Search: