The pure PHP graphics library

This library implements input, output and processing of raster images in pure PHP, so that image processing PHP extensions are not required.

This allows developers to eliminate some portability issues from their applications.

The basic usage is like this:

use Mike42\GfxPhp\Image;
$img = Image::fromFile("colorwheel256.png");
$img -> write("test.gif");


  • Format support includes PNG, GIF, BMP and the Netpbm formats.
  • Support for scaling, cropping, format conversion and colorspace transformations.
  • Pure PHP: This library does not require Gd, ImageMagick or GraphicsMagick extensions.


Install gfx-php by running:

composer install mike42/gfx-php

Indices and tables