This class can be used to crop images by removing common color borders.
It can load a picture and scan its border pixels to determine how thick is the border.
The sensibility level that is used to determine which pixels are in the border is configurable.
The class can crop the image be keeping on the interior inside the image border.
The resulting cropped image can be displayed in JPEG, PNG or GIF format, saved to a file or embedded in an HTML page.
Class won "PHP Programming Innovation Award" on phpclasses.org. Link.
require "removeBorderFromImage.php";
$rbfi = new removeBoderFromImage("img.jpg",0.95); //Color restrict factor, bigger multiplier = bigger crop area
$rbfi->saveImage("c:\\\\cropped", "png"); //Saves cropped image; available formats: png,gif,jpg
$rbfi->showImage(); //Sends cropped picture to browser
$cropped = $rbfi->getImage(); //Returns gd2 internal format image