PHP Classes

Remove Border From Image: Crop images by removing common color borders

Recommend this page to a friend!
  Info   Screenshots Screenshots   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 53%Total: 814 All time: 4,226 This week: 106Up
Version License PHP version Categories
removeborderfromimag 1.1Freeware5HTML, PHP 5, Graphics


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.

Innovation Award
PHP Programming Innovation award winner
March 2009

Prize: One copy of the Zend Studio
Sometimes it is necessary to process images in such way that they occupy the least possible size. One way to do that is to remove exceeding border thickness.

This class can do that by cropping the image by eliminating the sides of the image that have approximately the same color around the whole image.

Manuel Lemos
Picture of Pawel Antczak
Name: Pawel Antczak <contact>
Classes: 2 packages by
Country: Poland Poland
Age: 42
All time rank: 60216 in Poland Poland
Week rank: 122 Up3 in Poland Poland Up
Innovation award
Innovation award
Nominee: 1x

Winner: 1x

  • example
  Files folder image Files  
File Role Description
Plain text file removeBorderFromImage.php Class main class
Image file img.jpg Output test image
Plain text file index.php Example sample usage

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:4,226
This week:106Up
User Ratings User Comments (2)
 All time