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.
Development dependencies
See requirements.txt for other dev-dependencies.
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
Document
Todos
Add optimizer?
Changelog
0.2.0 (Dec 8, 2017)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file apng-0.2.0.tar.gz.
File metadata
- Download URL: apng-0.2.0.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c4bf2032eab606296d7584ecf5246b20f0aba2ebb675962b6b8ba1abc532b44
|
|
| MD5 |
dc9b6addf9e78d4a0ba2ef5d3da08b30
|
|
| BLAKE2b-256 |
db2db262d4d648e39edd5a23ad8cf2a4136fe8061d285b70f18c4536d6b1299f
|
File details
Details for the file apng-0.2.0-py3-none-any.whl.
File metadata
- Download URL: apng-0.2.0-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24ea68997216f00c3a80ee038793eb4f59b3afbab0bbb44da8c40d3780910579
|
|
| MD5 |
04985024646f434527633e14902a45c7
|
|
| BLAKE2b-256 |
2723afa827d07fdde7133a42cad6da0c609647b3fddaa72049b4ff088a06aaed
|