Live data from Hacker News

Gifski: Optimized GIF Encoder

github.com

51–60 of 65 posts

Re: Gifski: Optimized GIF Encoder

#51
post #6

I've used this for years and it's the best out there. Definitely use it for converting videos for Google Slides and such. But it's such a travesty that we're in 2024 and still using GIFs in place of videos. I guess it's not necessary on the web directly anymore, but so many other platforms, like Google, support GIFs but not videos. So we're all stuck encoding into an insanely space/cpu inefficient format just to get…

I really wish they could just make HTML support

    
and have it behave exactly like all other images in how CSS handles it (with auto loop, no controls). This would solve all the reasons people use GIFs in place of videos.

Like for example

    
should make the image occupy 100% of the width of the parent element and auto-scale the height according to the mp4's aspect ratio. You can't do this with the element without an extremely unintuitive wrapper div.

Re: Gifski: Optimized GIF Encoder

#52
post #42

Earlier quoted context omitted.

Maybe all it takes for this is a new canonical file extension, i.e. something like .m4g? The contract for these could be something like "no sound, default playback in a loop, 30 seconds or less; don't render if any of these requirements aren't met" to make sure people don't abuse it for auto-playing videos.

It's really more of a browser issue, a GIF you can just right click and download, but they don't make that option available for videos.

is a thing, but unfortunately it’s not supported outside Safari. https://stackoverflow.com/questions/60114243/using-videos-in...

Re: Gifski: Optimized GIF Encoder

#53
post #51
post #6

I've used this for years and it's the best out there. Definitely use it for converting videos for Google Slides and such. But it's such a travesty that we're in 2024 and still using GIFs in place of videos. I guess it's not necessary on the web directly anymore, but so many other platforms, like Google, support GIFs but not videos. So we're all stuck encoding into an insanely space/cpu inefficient format just to get…

I really wish they could just make HTML support and have it behave exactly like all other images in how CSS handles it (with auto loop, no controls). This would solve all the reasons people use GIFs in place of videos. Like for example should make the image occupy 100% of the width of the parent element and auto-scale the height according to the mp4's aspect ratio. You can't do this with the element without an extrem…

It should work in Safari https://stackoverflow.com/questions/60114243/using-videos-in...

Re: Gifski: Optimized GIF Encoder

#54
post #6

I've used this for years and it's the best out there. Definitely use it for converting videos for Google Slides and such. But it's such a travesty that we're in 2024 and still using GIFs in place of videos. I guess it's not necessary on the web directly anymore, but so many other platforms, like Google, support GIFs but not videos. So we're all stuck encoding into an insanely space/cpu inefficient format just to get…

I wish there was some kind of small, soundless video supporting transparency for emojis, stickers, small animations, diagrams in slide shows, etc, that is guaranteed to autoplay and loop without issues.

The problem with of course is that there's no way to tell if it's going to play an annoying sound, take a long time to load, change the screen brightness due to HDR features, require a weird proprietary codec, need the browser to render video controls, and so on. So they end up getting blocked from autoplay by default.

I suppose APNG or WebP are ideal for this but it is poorly supported, in that very few tools let you export to APNG or WebP --- browsers actually have decent support for this [1] and Discord uses APNG for stickers.

[1] https://caniuse.com/apng

Re: Gifski: Optimized GIF Encoder

#55
post #6

I've used this for years and it's the best out there. Definitely use it for converting videos for Google Slides and such. But it's such a travesty that we're in 2024 and still using GIFs in place of videos. I guess it's not necessary on the web directly anymore, but so many other platforms, like Google, support GIFs but not videos. So we're all stuck encoding into an insanely space/cpu inefficient format just to get…

One example is Stack Exchange (Stack Overflow) - supports GIFs up to 2 MB, but not videos.

GIFs up to 20MB on Reddit on most subs, but videos only on certain subs.

Re: Gifski: Optimized GIF Encoder

#56

Earlier quoted context omitted.

I wish WebM could be the standard. GIFs shouldn't even be used in 2024. It's a format of the past, with no upsides. I usually only need GIFs for GitHub readmes. GitHub doesn't support WebM autoplay videos. In texting, Telegram has introduced WebM stickers so there's at least a choice there.

Note that Github does support the slightly better animated WebP... as long as you change the file extension to .gif :)

The extension trick works in all sorts of place. And in reverse too. You can often upload an animated GIF to sites that don't support it by just changing the extension to .jpg or .png.

Re: Gifski: Optimized GIF Encoder

#57

My image optimization trio as of now: - GIF: gifski (squeeze out the best possible out of the ancient format) - PNG: pngquant (lossy but respectful of what many PNGs are: lots of flat surfaces + limited color palette, transparency) - JPG: jpegli (writing this post mostly to share the news about this one, it's new from libjxl learnings, approximately as good qualitatively as Guetzli, but 1000x faster -actual number, n…

I feel dense for advocating for jpegli to everyone and then totally forgetting to replace it in my export chain myself. The tools you quote should be the only ones used in 2024. Everything else should be scorched.

Re: Gifski: Optimized GIF Encoder

#58
post #45

If you don't want to use something more composed like this, the main trick gifski is doing is using a two-pass approach to generate a palette for the gif. You can do this pretty easily with just ffmpeg / ffprobe. Here's my personal script I use for generation: #!/bin/sh SCALE=500 FPS=15 SCALEPROVIDED=false for arg in "$@" do case $arg in -s=*|--size=*) SCALE="${arg#*=}" SCALEPROVIDED=true shift ;; -f=*|--fps=*) FPS="…

aside: find it funny (genuinely), you describe this as "pretty easy" xD. ffmpeg is so impressive but so daunting from a cli perspective to me. how do you even know whats possible! I would never have imagined it could generate palettes

Re: Gifski: Optimized GIF Encoder

#60

While Gifski is fantastic, I'd really like to know what kind of tech https://gifs.com uses. Their GIFs are really high quality and small in size. I thought they were using Gifski but I'm not sure about it.

Wish these services could be run locally. I'd even pay for it. For people at companies uploading a clip of something internal for a slide deck to a 3rd party is a non-starter.
Post reply on HN