Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webp compression #1

Open
0xNima opened this issue Jul 24, 2021 · 3 comments
Open

webp compression #1

0xNima opened this issue Jul 24, 2021 · 3 comments

Comments

@0xNima
Copy link

0xNima commented Jul 24, 2021

Hi Peter. First of all I want to thank you to developing this helpful tool. I have a question about the reducing of webp file size without changing the dimension. I want to convert Telegram animated sticker to WhatsApp sticker but it has a limitation of max 500kb file size. Do you know any method to do this?

@PeterMX
Copy link
Owner

PeterMX commented Jul 24, 2021

Hi, using -q 0 will reduce quallity and you will get smaller webps, but it will no be enought to get 500kb, with a small change in render.cpp in the for loop you can skip some frames and that will help you get those 500kb or smaller.

@0xNima
Copy link
Author

0xNima commented Sep 12, 2021

Hi again Peter. Now I can reduce the final size by skipping some frames and check the webp_data size and repeat again until to reach the desired size. The reason that I use this approach is that I want to remove less frames as much as possible.
I notice that in this approach, frames recalculated in each iteration. I tried to memoize the calculated frames by storing pic (in the addFrame method) in a map but it doesn't work.
Do you have any suggestion to cache the calculated frames?

@PeterMX
Copy link
Owner

PeterMX commented Sep 14, 2021

Hi, No, I don't know how to cache pic,
on the other hand, in your code you set 500000 as max size but it should be 512000(as said in Whatsapp repo), 12000 bytes is big enought to miss some valid stickers

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

No branches or pull requests

2 participants