skillfed

pypng

Pure Python library for saving and loading PNG images

pypng v0.20220715.0 8.7M downloads/30d#1,599 on PyPI
Permissive license MIT Abandoned released

What it is and what it does

PyPNG is a pure Python library for reading and writing PNG image files. It handles grayscale, RGB, and RGBA color modes and supports various PNG features like interlacing, transparency, and ICC profiles through command-line tools. The core module has no external dependencies, making it lightweight and portable—you can even copy the single file into your project and use it directly.

The library is designed for straightforward PNG I/O without the overhead of compiled image libraries. It includes both a Python API for programmatic use and several command-line tools for image manipulation and format conversion. However, the project has been abandoned since 2022-07-15, so there is no active maintenance or support for new features or bug fixes.

Use it for:

  • Generate simple PNG images programmatically from pixel arrays in pure Python environments
  • Read and write PNG files in applications that cannot depend on compiled libraries
  • Convert between PNG and other formats using the included command-line tools
  • Add or modify PNG chunks like ICC profiles and transparency via command-line tools
  • Join multiple PNG images horizontally or vertically using included utilities

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

PyPNG reads and writes PNG image files in pure Python with no external dependencies, supporting grayscale, RGB, and RGBA formats through a straightforward API.

Yes, if you need pure-Python PNG I/O with no external dependencies and can tolerate an abandoned codebase. The library is stable for basic read/write tasks and has no known vulnerabilities. Install only if you specifically require zero compiled dependencies or are working in a constrained environment; otherwise, more actively maintained alternatives may be preferable.

Install

pypng on PyPI

pip

pip install pypng

uv

uv add pypng

poetry

poetry add pypng

Installing pypng

Before you install

Installation is straightforward with low friction—the package is pure Python with zero runtime dependencies and installs via a simple wheel. However, the project is marked abandoned with no releases since 2022-07-15, so expect no active maintenance or bug fixes.

License in practice

MIT license permits commercial and private use with minimal restrictions, requiring only that you retain the license notice in distributions.

Quickstart

import pypng
pypng.from_array([[255, 0, 0, 255],
                  [0, 255, 255, 0]], 'L').save("image.png")

Requires Python 3.5 or later; the package is pure Python with no compiled dependencies.

Verify before relying

  • Whether the abandoned status affects real-world reliability for common PNG read/write tasks
  • Performance characteristics compared to other pure-Python PNG libraries or alternatives

Package facts

License MIT (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance abandoned — 1,491 days since the last release
First released
Downloads 8,671,088/month — #1,599 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pypng-0.20220715.0-py3-none-any.whl

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Multimedia :: GraphicsTopic :: Software Development :: Libraries :: Python Modules

Tags

png image read write pythonpure python png librarypng encoder decodersave load png filespng image manipulationgrayscale rgb pngpython png no dependencies
pure-pythonimage-formatabandoned

More Python Modules packages