APNG Animation using APNG Assembler (CUI)

Table of Contents

GIF animation has been popular since long ago, but in recent years APNG animation (Animation consisting of a time series of PNG files) seems to be becoming popular and supported by the latest major browsers, including Google Chrome. As software to create APNG, APNG Assembler (apngasm) is a standard. Although there is a GUI version on Windows, from the consistency with the Linux environment, I will summarize the creation method using the CUI version.

Install APNG Assembler

APNG Assembler web site. Download an appropriate file from List of files. For example, Windows 64 bit CUI binary is apngasm-2.91-bin-win64.zip and Linux CUI binary is apngasm-2.91-bin-linux.zip. Although you may install it on Ubuntu by sudo apt install apngasm, for consistency among systems, downloading the binary version is recommended.
After downloading it, extract it and copy it to a directory where PATH is set.

Create an animation

Open a command prompt for Windows or Linux. Suppose that a series of PNG files having continuous numbers
like frame000.png and frame001.png exist and the output animation file is animation.png.
Then you can create an animation as follows:

apngasm64 animation.png frame*.png 1 4

where arguments appearing after png file name are options and 1 4 means the frame rate of 4fps or 1/4 s. All the options are listed here and below:

1 10 : frame delay is 1/10 sec. (default)
-l2 : 2 loops (default is 0, forever)
-f : skip the first frame
-hs## : input is horizontal strip of ## frames (example: -hs12)
-vs## : input is vertical strip of ## frames (example: -vs12)
-kp : keep palette
-kc : keep color type
-z0 : zlib compression
-z1 : 7zip compression (default)
-z2 : Zopfli compression
-i## : number of iterations (default -i15)

Show animation

It is easiest to open the animation.png using Chrome. When animation.png file exists under C drive on Windows, open the browser specifying the file path as follows:

file:///C:/home/output/png/animation.png

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.