How do I convert a batch of .pngs into a single .apng?
I don’t remember where the original code is, maybe I forgot to save it but it’s fine. I found a site that explains the apng module.
On top of the other advice, Pillow is definitely worth considering for this. It’s a solid library that fits this use case perfectly.
I got it to work. Yay!
https://sh.itjust.works/pictrs/image/ae3e684e-dacd-4b98-8306-bc68715e3587.apng
Nice shitpost! What was your code to achieve this?
I currently don’t have the code. I didn’t save it…
I’ll give you a rough idea of what the modified code stack overflow did.
They imported pillow module.
Took the 6 labelled images from their storage.
Appended the images with a set delay of 100ms and saved it as one.
I’m not a coder, so I can’t remember the python code.
Don’t be shy, you are a coder now. Enjoy the chaos!
I’d use ImageMagick, but if you want to do it in plain* Python, here’s an example: https://stackoverflow.com/a/79683407
* Well, you’ll need pyAPNG.
I used pillow. It has apng support now.


