parsaaghayi / jpegoptimizer
0.0.2
2021-10-16 08:33 UTC
README
you can use it to resize and optimize your jpeg files in best quality and file size together.
this package use imagemagick; so you must install it first.
you can resize and optimize your images in any sizes you want, TOGETHER!
Only in One Line :
$statement->optimize($dir,$quality,$sizes);
example1:
require_once './vendor/autoload.php'; use ParsaaghayiJpegOptimizer\JpegOptimizer; $test = new JpegOptimizer; $test->optimize('../images/1','80',150,360);
this code will create a folder in "../images/1" and name it "resized", then creates two folders in it: "150x" & "360x". all images in directoy "../images/1" will optimze to quality "80" and will resize to 150px (width) and 360px (width).
Original Image (2940KB):
Resized Image To 1920x (1030KB):
Resized Image To 1366x (612KB):
Resized Image To 414x (85KB):
Resized Image To 150x (14KB):