skip to navigation
skip to content

apng 0.2.0

A Python module to deal with APNG file.

A Python module to deal with APNG file.


  • Merge multiple images into one APNG file. (It use Pillow to convert image into PNG format)
  • Read APNG file and extract each frames into PNG file.
  • It doesn’t do any optimization but only concat the images. This might be changed in the future.


  • Pillow - Optional. You can still use pyAPNG without PIL but it can only read PNG files.

Development dependencies

  • pngcheck
  • See requirements.txt for other dev-dependencies.


pip install apng


Convert a series of images into APNG animation:

from apng import APNG

APNG.from_files(["1.jpg", "2.jpg", "3.jpg"], delay=100).save("result.png")

Use different delay:

from apng import APNG

files = [
    ("1.jpg", 100),
    ("2.jpg", 200),
    ("3.jpg", 300)

im = APNG()
for file, delay in files:
    im.append(file, delay=delay)"result.png")

Extract frames from APNG file:

from apng import APNG

im ="animation.png")
i = 0
for png, control in im.frames:"{i}.png".format(i=i))
    i += 1


  • Add optimizer?


  • 0.2.0 (Dec 8, 2017)
    • Add test.
    • Add documents.
    • Add: support path-like object.
    • Fix: some chunks must appear before IDAT. (#1)
    • Fix: change chunks order in APNG. Some chunks are moved to the end of the file.
    • Fix: remove tRNS hack.
    • Fix: is_png shouldn’t move file pointer. (#2)
  • 0.1.0 (May 30, 2016)
    • First release.
File Type Py Version Uploaded on Size
apng-0.2.0-py3-none-any.whl (md5) Python Wheel py3 2017-12-07 7KB
apng-0.2.0.tar.gz (md5) Source 2017-12-07 5KB