The pure PHP graphics library
Clone or download
mike42 Merge pull request #32 from mike42/feature/test-coverage
Improve test coverage, related bug fixes
Latest commit 3ac1be9 Jun 10, 2018
Failed to load latest commit information.

gfx-php - The pure PHP graphics library

Build Status Latest Stable Version Total Downloads License Coverage Status

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.

Get started

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:

  • Rotate
  • 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:

  • JPEG
  • MNG
  • PAM format
  • XPM
  • .. 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

Similar projects

  • Imagine, which wraps available libraries.