Open Source PHP API to Manipulate Images

PHP Library that enables Software programmers to resize, sharp, merge, colorize, fill and rotate images.

The Gregwar's Image is an open source object-oriented library that gives software developers the capability to manipulate images inside their own PHP applications. Using the API, you can resize, scale resize, force resize, crop resize, zoom crop, crop, and negate images. Futhermore, the API also allows you to set brightness, contrast, convert image to grayscale, emboss the image, smooth the image, sharp image, colorize image and more.

The API never applies a feature on an opened image. Instead - The API first caches all the images and then applies the features. The API adds the image in operations array consisting of name, type and you can use the hash to look up for the file in the cache.

Previous Next

Getting Started with Gregwar's Image

It requires PHP 5.2+. You can easily install the Gregwar's Image library via composer. Please use the following command.

Install Gregwar's Image via Composer

{
    ...
    "require": {
        "gregwar/image": "2.*"
    }
}

Resize Images via Free PHP API

The open source Gregwar's Image library has provided support for resizing images inside applications. Using the API, the developer can simply import Gregwar library, open the image, resize it and save it. The resizing process is pretty simple and only requires one line of code. You can open the with open() method and resize it using resize() method.

Resize Image in PHP

  1. Import Library
  2. Open Image and pass image file path, resize it and provide output image size width and height.
  3. Negate the image colors and save the image

Resize Image via Free GO API

Image::open('fileformat.png')
     ->resize(100, 100)
     ->negate()
     ->save('output.jpg');