T
T
Timur Tunkin2022-02-03 12:30:26
gif
Timur Tunkin, 2022-02-03 12:30:26

How to replace a transparent background with a normal one in a gif?

I work with python 3.8 I
explain the situation:
I made a telegram bot, if a sticker is sent to it, it pulls out its id, forms a get request, receives a link to download the .tgs file, downloads it. Then, via the pylottie library, it converts it to a gif. But the gif is obtained with a transparent background (like png). Then it sends a message in the form of the "doc" type (via api VK). Everything is fine, but VK is very bad at reproducing (in the messenger) gif with a transparent background.

I wrote to them in support of VK, they answered "alas, this is so." They are not going to decide.
My solution is to either look for other ways to convert .tgs to .gif so that the background is not transparent.
Or convert gif with transparent to non-transparent.

Edit: Added VK support answer.61fba1b4addea814033442.jpeg

Everything must be implemented in python 3. I ask for help in finding solutions. What are the libraries? Maybe there are other options?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question