A PHP library for easy image handling. 🖼
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Jose Quintana ea336b4b1b fix: update api documentation link 3 months ago
.vscode php recommended extensions 1 year ago
docs fix: update api documentation link 3 months ago
examples image resource loading support 1 year ago
src PSR-2 format 1 year ago
tests update tests 1 year ago
.editorconfig docs build 2 years ago
.gitattributes ignore some files 2 years ago
.gitignore docs init 2 years ago
.travis.yml fix travis matrix 1 year ago
CHANGELOG.md v3.0.6 1 year ago
LICENSE.md docs: update readme file description 3 months ago
Makefile chore: update docs_deploy task 3 months ago
README.md docs: update readme file description 3 months ago
composer.json fix travis php versions 1 year ago
composer.lock fix travis php versions 1 year ago
mkdocs.yml chore: update mkdocs config 3 months ago
phpunit.xml PSR-2 3 years ago

README.md

GImage

Build Status Latest Stable Version Latest Unstable Version Total Downloads License

A PHP library for easy image handling. 🖼

A simple presentation card with GImage

Presentation card built with GImage - View code example

Features

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

  • Load an image from 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 in local or output on the browser.
  • Save several copies of the same image.
  • Render an image in-memory and return the resource.

Requirements

GImage requires PHP 7.x and latest GD Extension.

Install

composer require joseluisq/gimage

Usage

Load an external PNG image and save it as JPG:

<?php

use GImage\Image;

// PNG image (600x199)
$url = 'https://i.imgur.com/G5MR088.png';

$arch = new Image();
$arch
    // Load from URL
    ->load($url)
    // Scale to 50% (300x99)
    ->scale(0.5)
    // Change the format to JPG
    ->toJPG()
    // Saving in local path
    ->save('arch.jpg');

See GImage Website for detailed usage instructions and code examples.

Changelog

Check out the CHANGELOG.md file.

Contribution

If you would like to contribute pull requests and issues will be welcome! Feature requests are welcome. Please before sending some feature requests make sure provide as much detail and context as possible.

License

MIT license

©2015-present José Quintana