A PHP library for easy image handling.

v4.0.0 2022-10-24 21:08 UTC

This package is auto-updated.

Last update: 2024-02-26 20:43:02 UTC


Build Status Latest Unstable Version Total Downloads License

A PHP library for easy image handling. 🖼

GImage is a simple and small library based on PHP Image Processing and GD for processing images easily.

A simple presentation card with GImage

Presentation card built with GImage - View code example


  • Load an image from a local path, URL or image resource.
  • Create shapes such as rectangles or ellipses with opacity.
  • Resize, scale or crop images proportionally.
  • Rotate images, shapes or texts.
  • Embed text with custom TTF fonts.
  • Compose a pool of images with Canvas.
  • Swap image formats such as JPEG, PNG or GIF.
  • Save images locally or output them on the browser.
  • Save several copies of the same image.
  • Render an image in memory and return its resource.


GImage requires PHP 7.4 or a recent PHP version with the latest GD Extension.


composer require joseluisq/gimage


Load an external PNG image and save it as JPG:


use GImage\Image;

// PNG image (600x199)
$url = '';

$arch = new Image();
    // Load from URL
    // Scale to 50% (300x99)
    // Change the format to JPG
    // Saving in local path

See GImage Website for detailed usage instructions and more advanced examples.


Check out the file.


See code examples directory.


Run tests

Via Composer

composer install
composer run-script test

Via Docker (multi PHP versions test)

make docker-tests


Feel free to send some Pull request or file an issue.


This work is primarily distributed under the terms of the MIT license.

©2015-present Jose Quintana