Skip to content
This repository has been archived by the owner on May 15, 2023. It is now read-only.

[Lag Free Screenshots] Add WebP Support #231

Open
Zexxx opened this issue Jul 12, 2022 · 4 comments
Open

[Lag Free Screenshots] Add WebP Support #231

Zexxx opened this issue Jul 12, 2022 · 4 comments

Comments

@Zexxx
Copy link

Zexxx commented Jul 12, 2022

WebP has way faster compression algorithm along with much smaller file size compared to png. With encoding being faster this could help reduce the lag during the screenshot process.

@dakyneko
Copy link

dakyneko commented Jul 13, 2022

I've implemented this but @knah rejected the idea we would depend on other library like libwebp. I asked already 6 months ago and recently but same answer. So either I'll publish my own fork or he will accept a PR, who knows ;)

Also that claim about encoding being faster is not true, it's slower than both png and jpeg in my benchmark even as I'm using the method = 0 which is the fastest. That said I still think that cons is shadowed by the pros of webp.

@Zexxx
Copy link
Author

Zexxx commented Jul 13, 2022

That's odd that it's slower for you, maybe i should test it properly and not just use cwebp as a mini test. Although i would be very interested in it regardless if its slower than png for those benefits of significantly lower sizes. I had a png straight from in game at 16k come in at 192mb when converted to 66mb.
Altho please do make that fork!

@dakyneko
Copy link

dakyneko commented Jul 14, 2022

Altho please do make that fork!

We'll see if @knah is wiling to react. If not I could make a fork but beware that maintaining fork is effort. Tho it's true LFS itself didn't change much over time. I could consider making a fork if more people are interesting 🤔 I do have an open PR which improves speed by a lot #226 (still not merged), so yeah. I could ask to maintain the package at this point maybe :P I would be more active.

That's odd that it's slower for you, maybe i should test it properly and not just use cwebp as a mini test.

I'm not sure how you bench or where you saw that webp compression speed would be faster. In my experience and sources like: https://groups.google.com/a/webmproject.org/g/webp-discuss/c/mu1RYRAe72A?pli=1 or https://siipo.la/blog/whats-the-best-lossless-image-format-comparing-png-webp-avif-and-jpeg-xl they all agree encoding is slower. I didn't see anything to the contrary. But:

The results look promising on the compression side (up to 50% on some images), however encoding times are very slow - x5 slower on lossy, x10 for lossless compression.

That's not unusual ratio, indeed.

what's faster is the decompression: because of smaller size AFAIK https://developers.google.com/speed/webp/docs/webp_lossless_alpha_study

Decoding speeds faster than PNG have been demonstrated, as well as 23% denser compression than what can be achieved using today's PNG format. We conclude that WebP is a more efficient replacement for today's PNG image format.

That said, it's possible the IO is the bottleneck (esp with hard drives) to write the files down with huge size like ~200MB. Tho that isn't the subject of the bench above. Not sure if that's what you saw? In my testing I have m2 ssd so no bottleneck there.

@dakyneko
Copy link

As you know with EAC thing, this won't happen. But if you're interested: I ported lfs to cvr and I added webp support too.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants