V
V
Vadim2015-02-27 23:11:05
PHP
Vadim, 2015-02-27 23:11:05

How to properly resize images with minimal quality loss using Imagick?

Given: PHP script that performs image resizing using the Imagick library. And this is important - not from the command line, but through the PHP library.
And sometimes you have to reduce images ten or more times. I can't find clear instructions on how to do it better. The only thing I found was the advice to do a resize in several iterations, so that in one iteration it decreases by no more than 50%.
But imagick itself has several resize methods, plus a bunch of options. Maybe there are some ready-made recipes for the web (that is, it is also desirable to lighten the picture as much as possible, with minimal loss in quality)? Well, like, if you need to resize by 10%, then you set such and such options and use such and such methods, and if you need to reduce it by 10 times, then you do one, two, three.
I would be grateful both for links to such instructions, and for practical advice in the comments.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2015-02-28
@aspetek

I didn't pay much attention to resizing in several iterations, but in my opinion there is no difference.
I compress mainly through FILTER_LANCZOS, blur 1, I could not achieve better quality.
With strong compression, you can improve visual perception by applying unsharpMaskImage. The settings are selected individually, depending on the size, I have for previews for example (0 , 1 , 1, 0.05)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question