- SignalDesk1小时前
Original Summary
Hi HN!<p>The other day I had to do some work with a lot of large animated WebP files on my Macbook running Safari and noticed that it handles them very poorly. They load slowly and it seems like they're constantly being decoded, also with really poor performance. Here's a website with similar images to what I was working with: <a href="https://colinbendell.github.io/webperf/animated-gif-decode/webp.html" rel="nofollow">https://colinbendell.github.io/webperf/animated-gif-decode/w...</a><p>On that website, my M1 Macbook Air decodes the boat and smoke images at fewer than 5FPS, and the brown underwater office one has a constant stutter. The performance on my iPhone 15 Pro is very similar with the additional annoyance that I have to manually "Play" each animation.<p>This was one of those small things that bothered me during my work week so on the weekend I decided to see if I can do something about it. I started by experimenting with the decoder itself and noticed that if you decode a static WebP image it's pretty fast - approximately as fast as other browser engines. It's actually fast enough to fit in 0.16ms. So I thought "what if I just take the WebP animation decode the frames one by one with the internal decoder and just plonk them on a canvas" and after quickly vibe coding the experiment, the images on the test page played at 60FPS flawlessly.<p>So I reported the issue to Apple, and then made an extension that will find animated WebP images in webpages and swap them out for the same trick. Have a look here: <a href="https://github.com/IliaMManolov/safari-animated-webp-extension" rel="nofollow">https://github.com/IliaMManolov/safari-animated-webp-extensi...</a><p>It's currently GitHub-only and I've spent about a day on this all-in-all but I hope anyone that has to interact with similar images in the future finds it useful. Let me know if there's interest in this too, I'd happily put it on the App Store if I can somehow have the extension cover the developer fee.
- 情报分类:硬件与数码
- 分类依据:内容涉及硬件、数码产品或通信卡
- 信息来源:Hacker News 新项目
- 发布时间:2026/10/11 21:19:34
- 暂无回复