ImageResize is a small PHP library to resize images. Size of the image can be increased or decreased by keeping the aspect ratio of the image as it is.
This library is pretty simple in usage.
include_once("ImageResize.php");
$input = "inputImage.png";
$output = "outputImage.png";
$resizeObj = new ImageResize($input);
$resizeObj->resize($width = 200,$height = 300);
$resizeObj->output($output);
$new = new ImageResize($input);
$new->resize($width = 600, $height = 450);
$new->output($output);
Input Image:
Output Image:
$new = new ImageResize($input);
$new->options("colorpadding", true);
$new->resize($width = 600, $height = 450);
$new->output($output);
Input Image:
Output Image:
If you want to put any color in the padding area
$new = new ImageResize($input);
$new->options("colorpadding", true);
$new->resize($width = 600, $height = 450);
$new->options("paddingcolor", array(149,213,50));
$new->output($output);
$new = new ImageResize($input);
$new->options("crop-image", true);
$new->resize($width = 600, $height = 450);
$new->output($output);
Input Image:
Output Image:
OR, if you want to specify the percentage of image that can be cropped else pad-image with any color/blur image.
$new = new ImageResize($input);
$new->options("crop-percent", 50);
$new->resize($width = 600, $height = 450);
$new->output($output);



