How do I convert a batch of .pngs into a single .apng?

all 9 comments

sorted by: hot top controversial new old
[–] 7 points 7 months ago* (1 child)

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.

  • source
  • hideshow 1 child comment
  • [–] 5 points 7 months ago (4 children)

    On top of the other advice, Pillow is definitely worth considering for this. It’s a solid library that fits this use case perfectly.

  • source
  • hideshow 4 child comments
  • [–] [S] 3 points 7 months ago (3 children)
  • [–] 2 points 7 months ago (2 children)

    Nice shitpost! What was your code to achieve this?

  • source
  • parent
  • hideshow 2 child comments
  • [–] [S] 2 points 7 months ago* (1 child)

    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.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 3 points 7 months ago
    [–] [S] 1 point 7 months ago

    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.

    https://pypi.org/project/apng/

  • source