Hacker Timesnew | past | comments | ask | show | jobs | submitlogin
Gif.js – JavaScript GIF encoding library (github.com/jnordberg)
60 points by electic on Aug 8, 2014 | hide | past | favorite | 15 comments


There seems to be a lack of dithering in the resulting images on the test page that makes the banding in smooth gradient regions very noticeable. But other than that, amazing job! Maybe it is just a settings issue.


This is a killer library, it worked much better than our previous solution to gif-encoding on the frontend.

shameless plug: If you want to see a fun production use case of the gif.js library, check out https://imgflip.com/images-to-gif


I wonder how fast it would be without WebWorkers? Is it worth the complexity?


I haven't tried the library, so I can't attest to how fast/slow it is, but I think the point of using web workers is so that the gif can be produced asynchronously, without hanging the whole tab. So if you're producing a really giant image, yes, it would be worth it.


WebWorkers don't really add a lot of complexity to something like this.


Why bother with gif these days, and why in the browser?


Just because it's a crappy, outdated format doesn't mean a gif.js isn't useful.

That said, please don't use gifs. Use hosts like https://mediacru.sh/ that convert them to videos.

Please.


To those downvoting, what use cases make GIFs better than HTML 5


Lots of social media sites (like Google+) have much better gif support over things like webm. With G+, webms take like 15 seconds to open their fullscreen viewer, click play, wait for buffering, then watching it. Gifs just play right in the stream.

I'd personally love to see wider range support for animated webps, but I doubt that's going to happen for a long time, if at all.


I don't follow your comment, but I should have been more explicit:

gif is a waste of bandwidth compared to a soundless webm


Gifs work everywhere. They're heavy, but support is pretty much guaranteed. That's still not the case for webm.


If you're OK with screwing over Safari/IE users, you'll have pretty good support. You could engineer a browser-based fallback to gif, but honestly I wouldn't bother.

I'd imagine we can create an impetus to support it if we actually used it more


...and webm is a waste of CPU and memory compared to gif :-)

There are always tradeoffs.


GIFs are better on legacy browers


What is the rules for resubmitting old stuff? I remember this Git repo was posted 8 months back and double checked with the search at the bottom.




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

Search: