{"id":16332798,"url":"https://github.com/eight04/pyapng","last_synced_at":"2025-07-27T07:30:39.563Z","repository":{"id":57410972,"uuid":"59957849","full_name":"eight04/pyAPNG","owner":"eight04","description":"A Python module to deal with APNG files.","archived":false,"fork":false,"pushed_at":"2020-03-11T05:12:23.000Z","size":1101,"stargazers_count":42,"open_issues_count":2,"forks_count":11,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-27T18:49:44.509Z","etag":null,"topics":["apng","python","python2","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eight04.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-29T18:26:44.000Z","updated_at":"2024-10-08T19:39:00.000Z","dependencies_parsed_at":"2022-09-05T17:11:35.988Z","dependency_job_id":null,"html_url":"https://github.com/eight04/pyAPNG","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eight04%2FpyAPNG","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eight04%2FpyAPNG/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eight04%2FpyAPNG/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eight04%2FpyAPNG/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eight04","download_url":"https://codeload.github.com/eight04/pyAPNG/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227774668,"owners_count":17818072,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apng","python","python2","python3"],"created_at":"2024-10-10T23:33:01.170Z","updated_at":"2024-12-02T17:47:38.527Z","avatar_url":"https://github.com/eight04.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"pyAPNG\n======\n\n.. image:: https://travis-ci.org/eight04/pyAPNG.svg?branch=master\n  :target: https://travis-ci.org/eight04/pyAPNG\n  \n.. image:: https://readthedocs.org/projects/pyapng/badge/?version=latest\n  :target: http://pyapng.readthedocs.io/en/latest/?badge=latest\n  :alt: Documentation Status\n\nA Python module to deal with APNG file.\n\nFeatures\n--------\n\n- Merge multiple images into one APNG file. (It use Pillow to convert images into PNG format)\n- Read APNG file and extract each frames into PNG file.\n- It doesn't do any optimization but only concat the images. This might be changed in the future.\n\nDependencies\n------------\n\n- `Pillow \u003chttps://github.com/python-pillow/Pillow\u003e`__ - **Optional**. You can still use pyAPNG without PIL but it can only read PNG files.\n\nDevelopment dependencies\n------------------------\n\n- `pngcheck \u003chttp://www.libpng.org/pub/png/apps/pngcheck.html\u003e`_\n- See requirements.txt for other dev-dependencies.\n\nInstallation\n------------\n\nFrom `pypi \u003chttps://pypi.org/project/apng/\u003e`__::\n\n  pip install apng\n\nUsage\n-----\n\nConvert a series of images into APNG animation:\n\n.. code:: python\n\n  from apng import APNG\n    \n  APNG.from_files([\"1.jpg\", \"2.jpg\", \"3.jpg\"], delay=100).save(\"result.png\")\n    \nUse different delays:\n\n.. code:: python\n\n  from apng import APNG\n    \n  files = [\n    (\"1.jpg\", 100),\n    (\"2.jpg\", 200),\n    (\"3.jpg\", 300)\n  ]\n    \n  im = APNG()\n  for file, delay in files:\n    im.append_file(file, delay=delay)\n  im.save(\"result.png\")\n\nExtract frames from an APNG file:\n    \n.. code:: python\n\n  from apng import APNG\n    \n  im = APNG.open(\"animation.png\")\n  for i, (png, control) in enumerate(im.frames):\n    png.save(\"{i}.png\".format(i=i))\n    \nAdd a text chunk to the PNG file:\n\n.. code:: python\n\n  from apng import PNG, make_text_chunk\n  \n  im = PNG.open(\"image.png\")\n  im.chunks.append(make_text_chunk(key=\"Comment\", value=\"Some text\"))\n  im.save(\"image.png\")\n    \nPerformance\n-----------\n\nIf you want to convert some large JPGs into animation, the library has to convert your JPGs into PNGs then merge them into a single animation APNG file. The problems are:\n\n1. It is extremely slow.\n2. The file size of the APNG is extremely large. Probably 5x of the original or more.\n\nIn this case, I suggest trying an animation format called \"ugoira\", which is implemented by Pixiv.net. There is also an image viewer named \"HoneyView\" which can view it locally.\n        \nDocument\n---------\n\nhttp://pyapng.readthedocs.io/en/latest/\n\nTodos\n-----\n\n- Add optimizer?\n\nChangelog\n---------\n\n- 0.3.4 (Mar 11, 2020)\n\n  - Fix: exclude test files from the package.\n\n- 0.3.3 (Feb 11, 2019)\n\n  - Fix: failed to extract frames containing multiple ``fdAT`` chunks.\n\n- 0.3.2 (Jul 20, 2018)\n\n  - Add: ``make_text_chunk`` function.\n  - Add: ``Chunk`` data class.\n  - Change: now ``parse_chunks`` yields ``Chunk`` instead of a tuple. This should be safe since ``Chunk`` is a namedtuple.\n\n- 0.3.1 (May 13, 2018)\n\n  - Add: universal wheel.\n\n- 0.3.0 (May 13, 2018)\n\n  - Support Python 2.\n  - Add: PNG method ``open_any``, ``from_bytes``.\n  - Add: APNG method ``append_file``, ``from_bytes``.\n  - Add: module function ``parse_chunks``.\n  - **Drop: module function `is_png` and `chunks`.**\n  - **Change: `PNG.open` now only reads PNG images. To read non-PNG images, use `PNG.open_any`.**\n  - **Change: `APNG.append` now only accepts `PNG` instance. To append PNG files, use `APNG.append_file`.**\n\n- 0.2.1 (Apr 19, 2018)\n\n  - Add: support num_plays. (`#4 \u003chttps://github.com/eight04/pyAPNG/issues/4\u003e`_)\n\n- 0.2.0 (Dec 8, 2017)\n\n  - Add test.\n  - Add documents.\n  - Add: support path-like object.\n  - Fix: some chunks must appear before IDAT. (`#1 \u003chttps://github.com/eight04/pyAPNG/issues/1\u003e`_)\n  - Fix: change chunks order in APNG. Some chunks are moved to the end of the file.\n  - Fix: remove tRNS hack.\n  - Fix: is_png shouldn't move file pointer. (`#2 \u003chttps://github.com/eight04/pyAPNG/pull/2\u003e`_)\n\n- 0.1.0 (May 30, 2016)\n\n  - First release.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feight04%2Fpyapng","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feight04%2Fpyapng","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feight04%2Fpyapng/lists"}