gfx-php - The pure PHP graphics library
This library implements input, output and processing of raster images in pure PHP, so that image processing extensions (Gd, Imagick) are not required.
This allows developers to eliminate some portability issues from their applications.
- PHP 7.0 or newer.
- zlib extension, for reading PNG files.
- Have a read of the documentation at gfx-php.readthedocs.io
- See the
examples/sub-folder for snippets.
Status & scope
Currently, we are implementing basic raster operations on select file formats.
See related documentation for:
If you're interested in image processing algorithms, then please consider contributing an implementation.
For algorithms, it appears feasable to implement:
- Layered operations
- Affine transformations
- Lines, arcs, circles, and rectangles.
And sill on the roadmap for format support:
- BMP input, which involves RLE decompression (BMP output is already available).
- GIF input, which involves LZW decompression (GIF output is already available).
- TIFF input and output, which also involves LZW (de)compression.
In the interests of getting the basic features working first, there is no current plan to attempt lossy compression, or formats that are not common on either the web or for printing, eg:
- PAM format
- .. etc.
Also, as we don't have the luxury of pulling in dependencies, I'm considering anything that is not a raster operation out-of-scope:
- All vector image formats (PDF, SVG, EPS, etc).
- Anything involving vector fonts
Test data sets
- Imagine, which wraps available libraries.