pypng
Pure Python library for saving and loading PNG images
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 pypnguv
uv add pypngpoetry
poetry add pypngInstalling 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
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
pyoxipngpyoxipng reduces PNG file sizes through…
permissive · top 15,000 on PyPI
qrcodeGenerates QR codes as images (PNG, SVG) or…
permissive · top 1,000 on PyPI
PyQRCodePyQRCode generates QR codes in pure Python and…
permissive · top 15,000 on PyPI
pyjpeglsEncodes and decodes image data using the…
permissive · top 15,000 on PyPI
rawpyrawpy wraps LibRaw to load, decode, and…
permissive · top 15,000 on PyPI
qoiA Python wrapper for the QOI (Quite OK Image)…
permissive · top 15,000 on PyPI
pdf2imageConverts PDF files to PIL Image objects by…
permissive · top 1,000 on PyPI
fpdfGenerates PDF documents from Python code,…
copyleft · top 5,000 on PyPI
astc-encoder-pyastc-encoder-py compresses and decompresses…
permissive · top 15,000 on PyPI
OpenEXRRead and write OpenEXR image files with support…
unclear · top 15,000 on PyPI