Distort Resize

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
ageha
Posts: 2
Joined: 2016-02-18T08:15:07-07:00
Authentication code: 1151

Distort Resize

Post 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?
ageha
Posts: 2
Joined: 2016-02-18T08:15:07-07:00
Authentication code: 1151

Re: Distort Resize

Post 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"
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Distort Resize

Post 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.
snibgo's IM pages: im.snibgo.com
Post Reply