TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: gif.js - Fast GIF encoder using web workers

63 点作者 rwinn大约 12 年前

5 条评论

pornel大约 12 年前
That's cool. Have you tried to make GIF compression lossy?<p>The idea is that when looking for longest match in the dictionary you don't match colors exactly, but instead allow some difference. That can reduce file size by 20-30% (here's my take on it in C: <a href="https://github.com/pornel/giflossy/commit/5a9adbc0feb899a228ed068a0deec6fc1b954a85?w=1#L0L245" rel="nofollow">https://github.com/pornel/giflossy/commit/5a9adbc0feb899a228...</a>)<p>Another optimization is to set pixels that are similar between frames to transparent color. That sometimes massively improves quality, as you only generate palette for part of the image (so the palette is better) and several frames overlaid together may give more than 256 colors.
评论 #5738505 未加载
leeoniya大约 12 年前
this is potentially exactly what i've been looking for. i posted about where i ended up, using screen recording to capture canvas animations to gifs just a week ago <a href="https://news.ycombinator.com/item?id=5691742" rel="nofollow">https://news.ycombinator.com/item?id=5691742</a><p>this may not work for me though because i need to record a css-scaled, hard-edges (pixelated) canvas. (which works in ff but not in chrome) and want to do this at 60fps, so on each reqAnimationFrame.<p>maybe i can disable imagesmoothing on the canvas and scale each frame via callback before encoding it.
评论 #5738855 未加载
评论 #5738133 未加载
评论 #5738357 未加载
zokier大约 12 年前
I guess "fast" is bit relative. I get reported 1-3 second render times, meanwhile imagemagick converts the image from png-&#62;gif in about 40 milliseconds.
zombio大约 12 年前
This will save me so much time, thank you!
workbench大约 12 年前
Sites down at the minute, hows it stack up to omggif <a href="https://github.com/deanm/omggif" rel="nofollow">https://github.com/deanm/omggif</a> ? Example of that with web workers here : <a href="http://gifpaint.com" rel="nofollow">http://gifpaint.com</a>