Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I programmatically create APNG files? [closed]

Generally I use PHP, and ImageMagick, but as far as I can tell it seems the ImageMagick group refuse to implement the ability to create/understand animated PNG files?

What tooling can I implement to take a dozen JPEG files and create an animated PNG out of them? I'd prefer to have a PHP api, but I can branch out into another language if required!

like image 977
Codemonkey Avatar asked Jun 15 '26 17:06

Codemonkey


1 Answers

As of ImageMagick 7.0.10-31, Animated PNG is supported.

magick -delay 100 -loop 0 frame1.png frame2.png APNG:myanimation.png

parameters:
-delay 100 specifies a duration of 100 centiseconds (aka one second) per frame before moving on to the next frame.
-loop 0 tells the animation to repeat forever.
APNG:___.png specifies the output should be animated png.

(thanks to @fmw42 for improvements)

note: on MacOS Ventura, this seems to require ffmpeg as well.

like image 72
orion elenzil Avatar answered Jun 17 '26 23:06

orion elenzil