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

Emotes get unnecessarily compressed #11

Open
saucylegs opened this issue Dec 14, 2020 · 3 comments
Open

Emotes get unnecessarily compressed #11

saucylegs opened this issue Dec 14, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@saucylegs
Copy link
Contributor

Often when a GIF emote is added, the bot will compress it even if it is already less than 256kB. The result is the bot adds an emote that is much blurrier than it would be if it was added manually.

@ioistired
Copy link
Contributor

@saucylegs Would you mind sending an emote that's smaller than 256 kB but got compressed anyway?

@saucylegs
Copy link
Contributor Author

Now that I test this again, it appears that it only happens if you use an existing emote in the command, e.g. em/add test2 :test1:

That compressed this: https://cdn.discordapp.com/emojis/764339726664204350.gif?v=1
Down to this: https://cdn.discordapp.com/emojis/789429198774468608.gif?v=1

@ioistired
Copy link
Contributor

Discord imposes a limit of 256 KiB on emotes, yet that emote is in fact 294,544 bytes large. EM's strategy for compressing emotes is to just halve their size repeatedly until they're less than 256 KiB. So how did that emote get to be larger than the size limit in the first place? The most likely explanation is that the original image for that emote was larger than the size limit, so Discord itself tried to compress the emote, but it got larger when compressed or resized. Yes, GIF is really this horrible.

As for workarounds, you can try using gifsicle's optimization features before uploading. I'll leave this issue open as a reminder to try gifsicle within EM.

@ioistired ioistired added the enhancement New feature or request label Dec 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants