Though that's got nothing to do with why GIFs got so popular. That's purely because GIF is the only format that could display animations on every browser since 1995. The timing of PNG was rather unfortunate - the PNG team had decided on not supporting animation because GIF animation was rare and adding it to the spec would've unnecessarily complicated things. They froze the spec, planning to submit it to W3C and IETF for standardization - and then Netscape, in full "move fast and break things" mode, released Navigator 2 with animated GIF support. So soon every GeoCities page is full of annoying sparkly GIFs, PNG only lets you make boring stills, and we've got to support both formats forever.
More like a paragraph... https://en.wikipedia.org/wiki/Lempel%E2%80%93Ziv%E2%80%93Wel...
Personally, I like LZ more than LZW because it doesn't have to slowly "build up" the dictionary in the same way as LZW nor need bit-I/O (because you can have an 8, 16, or 32-bit "indicator", followed by that many literal or length/distance pairs) and thus makes for an even simpler (and faster) algorithm. The only downside is that it's more asymmetric, in that compression is usually far slower than decompression (which can be faster than memcpy() - see http://www.oldskool.org/pc/lz4_8088 ) because the former has to do a lot of searching while the latter is mainly copying memory.
There’s also a lossless webp variant.
One thing that would be nice would be a way to tell whether a WebP is lossy (in which case you should only edit/resize the original file, to prevent degradation), or lossless (edit as much as you please).
[1] https://discussions.apple.com/thread/250073758
[2] https://developer.microsoft.com/en-us/microsoft-edge/platfor...
In economics, the Jevons paradox (/ˈdʒɛvənz/; sometimes Jevons effect) occurs when technological progress or government policy increases the efficiency with which a resource is used (reducing the amount necessary for any one use), but the rate of consumption of that resource rises due to increasing demand.
(This kind of lossy encoding would be possible with PNG too, but most PNG encoders don't have a lossy mode.)
(GIF is now patent-free, but PNG and FLIF are still better compression than GIF anyways.)
Pngs get used for both for non photographic images and photographic images with alpha channel, and JPEG XL should win on both of those use cases.
It also cleverly has an upgrade story forexisting JPEGs so I imagine a fairly quick uptake where a proxy can recompress an existing sites images and get better size with no recompression loss.
Something nice about FLIF is partial decoding. You can reasonably see a thumbnail by downloading just 5% of the full lossless file.
In conjunction with HTTP2 to progressively load all visible images first, this is a killer feature for the web, simplifying thumbnails and responsive design while vastly speeding up page loads and improving caching.
1. Allow animations in the "Hero" user profile image.
2. Make that image permanently fixed to the top of the screen on the profile page.
3. As users increased window size to see more text and less hero, the image would scale to as much as 3/4 of the screen.
4. The hero was included on the "hover card" for users and would show up in all kinds of locations throughout the service. I still have that collection....
I spent an hour or so researching "annoying gifs", and settled on a rapid red-green-blue stroboscopic rotation. I don't know the cycle time, but it was probably a few times per second.
Google eventually relented. Well, they eventually shitcanned the whole site, but that's another story.
Trying to find animated images that weren't mind-bendingly annoying to me is how I ended up with the "space alien cat" image and avatar. The original had a rotating set of astronomical images in the glasses, I eventually applied the Crab Nebula as a static fill (tried the Cat's Eye, but ironically, it didn't work particularly well). That's the hero I use at several sites (Ello, Mastodon), and is the inspiration to the avatar I use as well.
Later at another site at which gratuitous annoying gif use was prevalent, I found a few static-but-apparently-moving optical illusion images, again to make the point that annoying images are annoying. The point was somehow missed by that crowd. That site also died.
TL;DR: animated gifs and even static images can be plenty annoying.
There is a trick where subsequent frames use transparency for non-changed parts of the image which gives a much better compression ratio than you might think.
In other words, similar to what video codecs do with "skipped macroblocks", except at a far more granular level. One wonders how efficient it would be if GIF was extended with things like motion vectors... but between the transparency/delta-enocding and the multi-palette "layering", you can sort of see the beginnings of a video codec.
This is so horrendously inefficient it should be a crime. But it's still a GIF, and anything that can display animated GIFs can display it too.
I am absolutely incredulous that people choose to use a GIF over a proper video format to share video on places like Reddit in this day and age. I don't understand the motivation to do so.
Also, where have you been able to casually upload video to share quick bites like a cat making a funny face? You aren't going to upload a 12 second silent video to youtube. Up until very recently, gifs were the only permissible way to share this sort of content.
Video, until maybe the last 5 years, didn't.
Also probably more addressable / available tools for anim gif creation.
Don't blame a web video format/standard for UI failures.
I think you don't understand the modern web. If something is crappy the user shall have it. JS was always considered crappy but now is the best new thing. And you also missed tbe latest web/UI/UX development. From the web designer point of view the user is an idiot which must be punished for every attempt to customize something.
> Don't blame a web video format/standard for UI failures.
They are not UI failures. They are done on purpose.
It could have very easily been better. I'm not sure what the moral is.
It's not that a bad deal though, one minute of video is roughly 7Mo for something close to DVD quality. I had GIFS lasting a few seconds weighting way more, with terrible quality.
I'm not that well-versed in the matter, is WebP already supported widely? I mean, not just on desktop and advanced smartphones?
For nicely optimized GIFs like these https://iwdrm.tumblr.com/ then WebP really struggles. Try to convert some of them to WebP and you'll see the result is often bigger than the original GIF.
Input #0, gif, from 'tumblr_nxt634tytr1qe0eclo3_r1_500.gif':
Duration: 00:00:08.64, start: 0.000000, bitrate: 1434 kb/s
Stream #0:0: Video: gif, bgra, 500x269, 16.67 fps, 16.67 tbr, 100 tbn, 100 tbc
vs Input #0, matroska,webm, from 'bar.webm':
Duration: 00:00:08.64, start: 0.000000, bitrate: 252 kb/s
Stream #0:0: Video: vp9 (Profile 0), yuv420p(tv), 500x269, SAR 1:1 DAR 500:269, 16.67 fps, 16.67 tbr, 1k tbn, 1k tbc (default)
1434kb/s for the gif, vs 252 kb/s for the VP9 webm. Even this highly optimized gif is only highly optimized by gif standards.And as a side note: png does not strictly compress better; sometimes the ability to use palette indexes that are smaller than 8 bits is an advantage.
PNG does support 4-, 2-, and 1-bit indexed modes :)
That being said, PNG always had much stronger compression, in addition to supporting 24- and 32-bit color. Nowadays, we even have WebP that usually compresses better than PNG, and compresses far, far better than animated GIF. Animated GIF is a pretty ugly hack to the format, very inefficient for many common kinds of animations (or full-blown video as it's often used now); I've found that animated WebP can produce files around 10% the size of GIFs.