Answer the question
In order to leave comments, you need to log in
Why does image size increase after resizing in Image Intervention?
Reducing the image size using Image Intervention:
$img = Image::make($image->getPathname());
$img->widen(1350)->save($this->getNewDirecoryName($folder, $image));
$img->widen(1350)->save($this->getNewDirecoryName($folder, $image), 70);
$img = Image::make($image->getPathname());
$img->widen(1350, function($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
});
$canvas = Image::canvas($img->getWidth(), $img->getHeight());
$canvas->insert($img, 'center');
$canvas->save($this->getNewDirecoryName($folder, $image));
Answer the question
In order to leave comments, you need to log in
The edges are blurred, causing more colors (anti-aliasing).
You can use k-nearest, but then the picture will become square when reduced (without anti-aliasing).
You can also try to reduce the number of colors: https://pngquant.org/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question