Skip to content

pawelantczak/crop-border-from-image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rmove Border From Image

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.

Award

Class won "PHP Programming Innovation Award" on phpclasses.org. Link.

Usage

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

Bitdeli Badge

About

This class can be used to crop images by removing common color borders.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages