-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
429 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
Metadata-Version: 1.1 | ||
Name: apng | ||
Version: 0.1.0 | ||
Summary: A python module to deal with APNG file. | ||
Home-page: https://github.com/eight04/pyAPNG | ||
Author: eight | ||
Author-email: eight04@gmail.com | ||
License: MIT | ||
Description: pyAPNG | ||
====== | ||
|
||
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 <https://github.com/python-pillow/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: | ||
|
||
.. code:: python | ||
|
||
from apng import APNG | ||
|
||
APNG.from_files(["1.jpg", "2.jpg", "3.jpg"], delay=100).save("result.png") | ||
|
||
Use different delay: | ||
|
||
.. code:: python | ||
|
||
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: | ||
|
||
.. code:: python | ||
|
||
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. | ||
|
||
|
||
Keywords: png apng image convert | ||
Platform: UNKNOWN | ||
Classifier: Development Status :: 5 - Production/Stable | ||
Classifier: Intended Audience :: Developers | ||
Classifier: License :: OSI Approved :: MIT License | ||
Classifier: Natural Language :: Chinese (Traditional) | ||
Classifier: Programming Language :: Python :: 3.5 | ||
Classifier: Topic :: Multimedia :: Graphics :: Graphics Conversion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
README.rst | ||
setup.py | ||
apng/__init__.py | ||
apng.egg-info/PKG-INFO | ||
apng.egg-info/SOURCES.txt | ||
apng.egg-info/dependency_links.txt | ||
apng.egg-info/top_level.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
apng |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
import itertools | ||
import io | ||
|
||
__version__ = "0.0.0" | ||
__version__ = "0.1.0" | ||
|
||
try: | ||
import PIL.Image | ||
|
Oops, something went wrong.