SimpleImage 3.0

Back in 2011, I released the first version of SimpleImage for PHP — an open source project for working with images.

Today, version 3.0 has landed, and there's a lot to love about it.

Overview #

Here's how it works at a glance:

try {
 // Create a new SimpleImage object
 $image = new claviska\SimpleImage();

 // Magic! ✨
  ->fromFile('image.jpg') // load image.png
  ->autoOrient() // adjust orientation based on exif data
  ->resize(320, 200) // resize to 320x200 pixels
  ->flip('x') // flip horizontally
  ->colorize('DarkBlue') // tint dark blue
  ->border('black', 10) // add a 10 pixel black border
  ->overlay('watermark.png', 'bottom right') // add a watermark image
  ->toFile('new-image.png', 'image/png') // convert to PNG and save a copy to new-image.png
  ->toScreen(); // output to the screen

 // And much more! 💪
} catch(Exception $err) {
 // Handle errors
 echo $err->getMessage();

Requirements #

Features #

The readme has a list of changes from the 2.x version of SimpleImage.

Download #

Download the latest version on GitHub.