Skip to main content

A python module to deal with APNG file.

Project description

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.


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

Checkout the source for the details.


  • Add optimizer?


  • 0.1.0 (May 30, 2016)

    • First release.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution (7.2 kB view hashes)

Uploaded Source

Built Distribution

apng-0.1.0-py3-none-any.whl (6.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page