PHP library for create, scaling, cropping and compare images
//Cut a jpg picture to a 16: 9 format and save it as png
require '/yourpath/Gdimage.php';
$quality = 95; //95%
gdImage::create('mypicture.jpg')
->adjust(16,9)
->saveAsFile('mypicture.png',$quality)
;
//Distance of two pictures
$gdImg = gdImage::create("img1.jpg");
//Uses a 4x4 color matrix for comparison
$size = 4;
$distance = gdImage::create($imgPath."img2.jpg")
->distance($gdImg, $size)
;
http://jspit.de/tools/classdoc.php?class=Gdimage
http://jspit.de/check/phpcheck.class.gdimage.php
- PHP 7.x