News for hackers. Stuff that matters.
Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by marcan_42 on Friday May 21, 2021 @03:53AM (#27231524)
Browsers and other players will generally be fine, as they render the image progressively. However, editors /processing tools which attempt to load it as a series of frames or a video will usually break, as memory consumption explodes, unless they have a smart disk buffer system to handle it.

I wouldn't be surprised if some poorly implemented players were built on top of abstraction layers that end up flattening the whole thing too and also break, but browsers at least generally do it right.

Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by slver on Friday May 21, 2021 @07:02AM (#27232534)
And this kids, is why we have key and delta frames.

We should drop gif support.

Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by paulryanrogers on Friday May 21, 2021 @08:25AM (#27233129)
Why not cap animated gifs at a maximum duration or file size? GIFs original use cases are already served by formats better suited to the modern era.

Their continued popularity seems due mostly to their historical auto play behavior. One that apps are so reluctant to disrupt we're filling landfills with electronic waste to keep up with ever larger and longer meme animations.

Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by slver on Friday May 21, 2021 @08:39AM (#27233254)
It's too late to (re)define GIF.

Actually software which edits animated GIFs doesn't have to crash per se, it's all about how smartly it's implemented, and because GIF editing isn't exactly a sprawling industry, most apps tend to be, well, not that smart, and so edge cases can get them.

Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by paulryanrogers on Friday May 21, 2021 @08:47AM (#27233334)
Formats don't have to be fully implemented to their original spec for all time. If it's not serving us well today then we can change how our software uses it.
Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by Wowfunhappy on Friday May 21, 2021 @09:10AM (#27233545)
They kind of do, though, or you lose compatibility.

There are a lot of corners of the internet which just haven’t been touched in a decade. Are you going to break all of them? For what purpose?

Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by paulryanrogers on Friday May 21, 2021 @09:37AM (#27233815)
Is it really much of a loss that very large or long GIF animations required click-to-play?
Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by oauea on Friday May 21, 2021 @04:23PM (#27239446)
Yes, it would be immense. Many gifs have been used for user interface elements and such a change would break that completely.
Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by paulryanrogers on Friday May 21, 2021 @09:20PM (#27242250)
I'm not suggesting some modest, >1KB spinners should be gated like this.

Rather that renderers / apps would put a pause on downloading and processing very large (say 1MB+) or very long animations (100+ frames).

Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by oauea on Saturday May 22, 2021 @01:32AM (#27243797)
I think you are underestimating gif sizes if you think a 1MB gif is large.
Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by burnished on Sunday May 23, 2021 @12:35AM (#27252489)
but would your example, crucial, gif ui elements be that large? that seems odd
Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by beckingz on Friday May 21, 2021 @09:07AM (#27233516)
Wouldn't it be better to make a new specification that provides backwards compatibility?
Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by paulryanrogers on Friday May 21, 2021 @09:39AM (#27233844)
If the goal is to stop obscene memory and bandwidth bloat then changing the default to a click-to-play/load would be better. My thinking is too change the incentives so producers aren't exploiting an old format to force autoplay at the expense of wasted resources and user control.
Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by niutech on Monday May 24, 2021 @10:15AM (#27264607)
You can use <video autoplay loop muted playsinline> for an auto-playing cross-browser animated GIF replacement.
Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by asddubs on Friday May 21, 2021 @08:34AM (#27233204)
i'm pretty surprised apng hasn't really displaced gif, at least not completely. a lot of people don't seem to even be aware pngs are animatable these days
Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by dspillett on Friday May 21, 2021 @09:33AM (#27233764)
Lack of awareness is the main issue by far, but momentum is another. gifs are doing the job and people already have tools they are used to, so there needs to be some compelling reason to switch. For many small animated icons the file-size difference isn't going to be massive and an 8-bit pallet is usually sufficient, and once you start wanting larger animations and full-colour people have already moved to video codecs instead or for non-video-like animations maybe even manipulating SVG. There are no doubt sweet spots where APNG is ideal, or even the only really good option, though I can't think of any that would be common (wanting an animation with an alpha-channel rather than gif's all-or-nothing, maybe).

Another matter is compatibility. IE11 is a no-go which even after the recent announcement will kill APNG for some. And while Edge now supports it this has only been the case since the switch to being Chromium based (so the beginning of last year).

Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by mywittyname on Friday May 21, 2021 @10:35AM (#27234495)
I think this is because video codecs superseded everything else. An MP4 file is going to be roughly the same size as an apng, while enjoying hardware acceleration on a lot of devices out there.

There's still the weird niche of lossless compression where apng or webp would be preferred.

Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by acdha on Friday May 21, 2021 @11:54AM (#27235655)
20 years ago the case was stronger but video codecs have both soaked up the performance wins and do not expose new security exposure.

Based on APNG and JPEG 2000, the only question I have for new formats is how they plan to get browser support. It’s a hard path to relevance unless you have a good answer for that (even if it’s, say, a WASM fallback).

Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by asddubs on Friday May 21, 2021 @12:33PM (#27236258)
a wasm fallback for a format is a perverse yet interesting idea. Seems like the main hurdle for new formats (at least patent unencumbered ones) is safari. webp finally made it in, av1, there's a pull request but we'll see what happens
Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by FalconSensei on Friday May 21, 2021 @04:51PM (#27239807)
I think they don't work on Slack, Whatsapp and other apps
Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by FalconSensei on Friday May 21, 2021 @12:11PM (#27235927)
> We should drop gif support.

We just need an actual replacement that has the same behaviours and actually works everywhere, as gif does. Videos are not a replacement, and other image formats don't work everywhere

Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by dragontamer on Friday May 21, 2021 @12:33PM (#27236259)
H.264 level 4.0 seems to have similar behaviors and works on a very wide variety of platforms in my experience.

Chrome, Firefox, Edge, Android, and iOS. That covers most of what we want, right? It fails on say... a 2009 era netbook or Android Gingerbread, but we gotta draw the line somewhere.

Even if you do care about Android Gingerbread: H264 3.0 Baseline profile IIRC worked on that (though its been a decade, so maybe I'm getting version numbers mixed up...). Going back to H.264 3.0 Baseline would reduce your compression-efficiency (more distortion / noise at same filesize, or larger filesize for same levels of distortion), but greatly improve your compatibility with decade-old devices if you cared.

Even H.264 3.0 Baseline is a far superior format compared to GIF though.

-------------

Lol audio is a mess though. But video-only is actually way better than most people expect.

Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by iainmerrick on Friday May 21, 2021 @01:17PM (#27236940)
Can you declare a video as looping, and have that correctly honored everywhere it plays?

That has always Just Worked with GIFs, but the last time I checked (a couple of years ago) it basically never worked with any “proper” video format.

Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by dragontamer on Friday May 21, 2021 @01:38PM (#27237234)
Most of gfycat's traffic these days is .mp4 files that pretend to be gifs. Even if you upload a gif, its converted into .mp4 because its a far more efficient transmission codec.

I'm sure there's some javascript / backend logic that handles some corner cases. But... yeah. A lot of self-looping .mp4 stuff seems to be solved. The <video> tag has been getting more and more consistent these days.

I just do some hobby stuff though. I only test on the stuff close to me (chrome, edge, firefox, my phone). So I can't say too much about reliability on older / more obscure platforms.

Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by FalconSensei on Friday May 21, 2021 @02:44PM (#27238176)
Twitter does the same, and I (along with other people) hate it. I mean... nice that it saves data, but I can't save it. To download an image is SO simple, but have to rely on 3rd party services to convert the video back to gif if I want to post it as gif on twitter later, or send as gif on whatsapp.
Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by dragontamer on Friday May 21, 2021 @02:45PM (#27238195)
I know enough about the debugging terminals in Chrome and Firefox to just "save-as" the .mp4 file itself. So I personally haven't had any problems with saving or sharing .mp4s. (Most commonly: grabbing some animated .mp4 meme and copy/pasting it into Discord)

But yes: its weird that Chrome / Firefox don't have easy-to-use "save as" buttons on .mp4s. But just grab the .mp4 and share the .mp4 on whatever services you use.

Increasingly, it seems like .mp4 is becoming the new gif. Its not quite as user friendly yet, but there's all sorts of advantages compared to .gif.

Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by FalconSensei on Friday May 21, 2021 @03:02PM (#27238455)
> I know enough about the debugging terminals in Chrome and Firefox to just "save-as" the .mp4 file itself.

Right, so this just don't work for like 90% of the population, or when you are on mobile, right?

Edit: what I mentioned about saving the mp4 and having problem later is: if I save the video and then try to re-share it on Twitter, it will be shared as a video, and not as a gif - or at least that was the case last time I tried

Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by niutech on Monday May 24, 2021 @10:19AM (#27264651)
Yes, just use <video autoplay loop muted playsinline>
Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by FalconSensei on Tuesday May 25, 2021 @01:02PM (#27279357)
That's when you are posting a video on your own website.

If you are posting a gif on a comments section of a website, or uploading to tumblr, for example, you don't have this control

Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by niutech on Sunday May 30, 2021 @05:48AM (#27331994)
That's the failure of Tumblr or any website that it doesn't optimize huge uploads by converting it to sane formats.
Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by FalconSensei on Friday May 21, 2021 @01:04PM (#27236747)
Can I just upload a H.264 level 4.0 video anywhere where an image is allowed and it will be displayed as an image? Will it be displayed as an image in any forum, chat/messenger platform? Can I use it as my avatar in places that allows for gif avatars, like Mastodon?

edit: grammar

Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by dragontamer on Friday May 21, 2021 @01:41PM (#27237276)
Hmm, I'm thinking about the Web-browser level (Chrome / Edge / Firefox) instead of say, web-application layer (ie: PHPbb vs XenForo).

The web browsers seems to have significantly improved compatibility of <video> in recent years, and even had decent compatibility 10 years ago (if you use Baseline profile H.264 3.0 videos and Javascript to smooth over some edges).

Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by FalconSensei on Friday May 21, 2021 @02:47PM (#27238220)
I've seen this debate happening for so many years, and people will not stop using gifs until other solution works exactly as a gif for the end user. APNG or WEBP would be a better solution, as they are images in the end.

You say they had decent compatibility 10 years ago, but no. At least a couple years ago you still needed many fallbacks and it was a hassle to guarantee the video would show properly. Not to say that you wouldn't be able to share it as image to tumblr/pinterest for example.

Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by Andrex on Friday May 21, 2021 @01:29PM (#27237099)
Animated PNG is supported in every single modern browser, and degrades gracefully (the first frame is at least rendered.)

https://www.caniuse.com/apng

WebP support (including animation) was added to the most recent major version of Safari, meaning WebP has similarly widespread support.

https://www.caniuse.com/webp

Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by astrange on Saturday May 22, 2021 @06:54AM (#27245322)
> Animated PNG is supported in every single modern browser, and degrades gracefully (the first frame is at least rendered.)

That’s part graceful and part a security hole. It means you can hide any image you want if moderation tools don’t show past the first frame.

Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by dstaley on Friday May 21, 2021 @03:13PM (#27238586)
One interesting aspect of WebP support (or lack thereof) is that it doesn't work in Slack or Discord, even when those are running in a supported browser. I think things like this are inhibiting adoption of newer formats.
Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by FalconSensei on Friday May 21, 2021 @02:54PM (#27238327)
That is a way better solution, although APNG didn't help much for my test in terms of data, a 1.8mb gif was converted to a 1.5mb apng, not even worth my time to google gif to apng converter.

Webp worked well though, resulting in a 300kb webp. Might try to start using it

edit: nevermind, webp doesn't work on whatsapp.