Intervention Image

Intervention Image is an open source image handling and manipulation wrapper library using PHP GD library.

The class is written to make PHP image manipulating more easier and expressive. No matter if you want to create image thumbnails, watermarks or format large image files Intervention Image helps you to manage every task in an easy way with as little lines of code as possible.

The library follows the FIG standard PSR-2 to ensure a high level of interoperability between shared PHP code and is fully unit-tested.

Getting started

The library requires at least PHP version 5.3 and comes with Laravel 4 Facades and Service Providers to simplify the optional framework integration.

Read the installation guideRead about Laravel 4 integration

Basic Examples

  1. // open an image file
  2. $img = Image::make('public/foo.jpg');
  3. // now you are able to resize the instance
  4. $img->resize(320, 240);
  5. // and insert a watermark for example
  6. $img->insert('public/watermark.png');
  7. // finally we save the image as a new image
  8. $img->save('public/bar.jpg');

Method chaining

Do the same in one line of code.

  1. $img = Image::make('public/foo.jpg')->resize(320, 240)->insert('public/watermark.png');

To view more code examples read the documentation on the individual methods make, resize, insert and save.