Page 1 of 1

Distort Resize

Posted: 2016-02-18T08:26:55-07:00
by ageha
How do I use Distort Resize in perlmagick and actually define the dimensions?
This is what I use on the terminal:

Code: Select all

convert input.png -filter Lanczos -distort resize x1080 out.jpg
Which does exactly what it should, but my problem is that I just can't figure out how I recreate exactly that in perl.

from what I understand this is how one uses distort:

Code: Select all

$x = $image->Distort(method=>'Resize');
but how do I specify x1080 as the target height and use Lanczos as filter?

Re: Distort Resize

Posted: 2016-02-19T13:06:06-07:00
by ageha
I think I answered my own question, after reading up again on the usage pages about distort and resizing I learned that it is actually the affine method from -distort

so after playing around a bit I think what I really wanted is this:

"-distort resize x1080" is probably equal to this -> "+distort Affine '0,0 0,0 0,%h 0,1080' -crop x1080+0+0"

Re: Distort Resize

Posted: 2016-02-19T17:38:59-07:00
by snibgo
I know nothing about the Perl interface, but the documentation http://www.imagemagick.org/script/perl-magick.php lists Distort Resize (and Affine), and Filter.