Skip to main content

A python module to deal with APNG file.

Project description

A python module to deal with APNG file.

Features

  • 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.

Dependencies

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

Install

pip install apng

Usage

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)
im.save("result.png")

Extract frames from APNG file:

from apng import APNG

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

Checkout the source for the details.

Todos

  • Add optimizer?

Changelog

  • 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

apng-0.1.0.zip (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file apng-0.1.0.zip.

File metadata

  • Download URL: apng-0.1.0.zip
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for apng-0.1.0.zip
Algorithm Hash digest
SHA256 cece63c3f29e51233028f543b56e7824a40ea0fbb1f2353eba3418037d7be787
MD5 2807d828e7d75e7eee5797e2ce6e6572
BLAKE2b-256 557d5822d28696fd16b57186fd669f6fe31983f4a550b0deda4722cef4b60383

See more details on using hashes here.

File details

Details for the file apng-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: apng-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for apng-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 34b59c20a79405b0d52acbf2f6cd4a6848c3b2d0ca53f15b9028ea2ad0724f24
MD5 372a13efc2f43e7d092058657782ca8b
BLAKE2b-256 c1b655c7d7d06d2a6c8ce0321649b4c645de6c905945ef06228e0b40f50da288

See more details on using hashes here.

Supported by

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