During the process of investigating the GIF size limits, I also discovered that even if a sticker has transparency, this transparency is lost when the sticker is sent to WeChat:
To address this transparency issue, I found that decoding the WEBM files from Telegram correctly and using palettegen with the reserve_transparent flag, then encoding to GIF can retain transparency in a way that WeChat recognizes.
This pull request also tried resolves the transparency loss issue when sending tgs stickers from Telegram to WeChat via EFB, but there might still be an issue with the first frame of some TGS stickers having a black background.
During the process of investigating the GIF size limits, I also discovered that even if a sticker has transparency, this transparency is lost when the sticker is sent to WeChat:![image](https://github.com/ehForwarderBot/efb-telegram-master/assets/44089074/2d519826-d2f8-4811-a744-b984367491e8)
To address this transparency issue, I found that decoding the WEBM files from Telegram correctly and using palettegen with the reserve_transparent flag, then encoding to GIF can retain transparency in a way that WeChat recognizes.
This pull request also tried resolves the transparency loss issue when sending tgs stickers from Telegram to WeChat via EFB, but there might still be an issue with the first frame of some TGS stickers having a black background.
在研究 GIF 大小限制的过程中, 我还发现即使原始贴图有透明背景, 发送到微信后也会丢失透明度, 变成不透明的黑色背景:![image](https://github.com/ehForwarderBot/efb-telegram-master/assets/44089074/f0ed31eb-3d0e-4fa2-abe3-be5f25640f7f)
为了解决这个透明度丢失的问题, 我发现正确解码 Telegram 的 WEBM 文件, 并在生成调色板时使用 reserve_transparent 标志, 然后编码成 GIF, 就能以微信可识别的方式保留透明背景。