single |
# README for PyPNG
drj@pobox.com
# INTRODUCTION
PNG module for Python. PyPNG is written entirely in Python.
- PyPNG home page: https://gitlab.com/drj11/pypng/
- PyPNG Documentation: https://pypng.readthedocs.io/en/latest/
- PyPNG mailing list: https://groups.google.com/forum/#!forum/pypng-users
## QUICK START
import png
png.from_array([[255, 0, 0, 255],
[0, 255, 255, 0]], 'L').save("small_smiley.png")
After that, try `import png` then `help(png)`.
Also, lickable HTML documentation appears in the `html/` directory.
If HTML is no good then you could try the ReST sources
in the `man/` directory.
## INSTALLATION
PyPNG is pure Python and has no dependencies.
It requires Python 3.5 or any compatible higher version.
To install PyPNG package via pip use:
python -m pip install
git+https://gitlab.com/drj11/pypng@pypng-0.20220715.0
After install use
`import png`
to access the `png` module in your Python program.
You can also install from source using `setuptools`.
PyPNG uses `setup.cfg` and `pyproject.toml` to record its
configuration.
To install from (version controlled) sources using a suitable
version of `pip`:
`cd` into the directory and execute the command:
python -m pip install .
PyPNG is so simple, that you don't need installation tools.
You can copy `code/png.py` wherever you like.
It's intended that you can copy `png.py` into
your application and distribute it.
The following `curl` command should copy the latest version into
your current directory:
curl -LO https://gitlab.com/drj11/pypng/-/raw/main/code/png.py
## RELEASE NOTES
(For issues see https://gitlab.com/drj11/pypng/-/issues/ )
### Release (the next)
### Release 0.20220715.0
Development moved to gitlab: https://gitlab.com/drj11/pypng
If you pass an empty file to PyPNG
it now raises the builtin Python exception `EOFError`.
This should make it easier to diagnose _empty file_ problems separately
from genuine format errors
(which use `png.FormatError`).
This is a slightly breaking change to the API.
New `prirowpng` tool to join PNG images in a row left-to-right
(old internal `pipcat` tool).
New `pricolpng` tool to join PNG images in a column top-to-bottom.
Support for plain PGM files (magic number P2) added to `pripamtopng`.
New `priplan9topng` tool to convert from Plan 9 image format to PNG.
In reality this has been lurking in the codebase for years, but
has recently been converted to Python 3.
The author has only a limited collection of Plan 9 images,
which limits the testing that can be done.
The author welcomes bug reports for Plan 9 images.
The `priplan9topng` tool has an even more experimental option
`--font` which converts Plan 9 subfont files to a sequence of
PNG files.
### Release 0.0.21
Support for Python 2 is dropped.
Python 3.5 and onwards are supported.
Some of the ancillary tools are modified to work on Python 3.
|