Page 1 of 1

(the new) -distort Resize method in PerlMagick?

Posted: 2011-04-12T07:15:36-07:00
by NicolasRobidoux
What needs to be done to add a method already in IM to PerlMagick?

Re: (the new) -distort Resize method in PerlMagick?

Posted: 2011-04-12T07:53:47-07:00
by magick
Are you sure it doesn't work already? The $im->Distort() method is supported by recent versions of PerlMagick.

Re: (the new) -distort Resize method in PerlMagick?

Posted: 2011-04-12T09:35:09-07:00
by NicolasRobidoux
I'll check and report back. Perl "Distort" did not appear to take the "resize" option according to the documentation http://www.imagemagick.org/script/perl-magick.php ("only" Affine, AffineProjection, Bilinear, Perspective, ScaleRotateTranslate), hence the question.

Re: (the new) -distort Resize method in PerlMagick?

Posted: 2011-04-12T17:48:08-07:00
by NicolasRobidoux
'Can't seem to figure how to get -distort resize to work from PerlMagick.

-----

Now:

I am doing some consulting for a private company that does all its image
processing with PerlMagick.

I'd like them to be able to use -distort resize, because of http://imagemagick.org/discourse-server ... 22&t=18514

Re: (the new) -distort Resize method in PerlMagick?

Posted: 2011-04-12T20:05:38-07:00
by fmw42
My guess is that -distort resize is too new and has not yet been folded into Perlmagick

Re: (the new) -distort Resize method in PerlMagick?

Posted: 2011-04-28T18:53:35-07:00
by anthony
The low level MagicCore Distort resize method take two arguments, both an integer (even though it is floating-point input) of the exact final size of the image. No aspect ratio handling or other special flags that a resize geometry argument provides.

The CLI for distort Resize does the processing of geometry to final integer size, just like it would -resize, and other resize like operations too. The other API's interfaces (including pelrmagick) would have duplicated these actions.

More than likely PerlMagick Distort() only takes the final size numbers. only. I have no idea how 'resize geometry' handling should be done in perlmagick, as I am not involved in that API (or others).

I have no idea how a resize geometry should be added to the PerlMagick Distort() function, though I can see that it would be a useful addition.



Inputs other than simple 'array of floats' is likely to become more common, as this is a major sticking point for future Distorts(). Having CLI handle that, is a stop gap measure, as really it should be a dedicated 'string/file to distort input' type function, as an alternative method of argument specification.

For example a Grid distort could use an array of floats, but it is much more difficult to add a complex triangualition distort (for true image morphing), or 'sequence of local distorts' (see paper Interactive Image Warping) using such a limited input method.

Of course before that I need to add a whole new level of distortion handling into the main loop of the distort function, so I can process different areas of the image with different distorts, or distort coordinates multiple times before doing the lookup from the source.

Sorry I'm rambling. :)