(the new) -distort Resize method in PerlMagick?
-
- Posts: 1944
- Joined: 2010-08-28T11:16:00-07:00
- Authentication code: 8675308
- Location: Montreal, Canada
(the new) -distort Resize method in PerlMagick?
What needs to be done to add a method already in IM to PerlMagick?
Re: (the new) -distort Resize method in PerlMagick?
Are you sure it doesn't work already? The $im->Distort() method is supported by recent versions of PerlMagick.
-
- Posts: 1944
- Joined: 2010-08-28T11:16:00-07:00
- Authentication code: 8675308
- Location: Montreal, Canada
Re: (the new) -distort Resize method in PerlMagick?
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.
-
- Posts: 1944
- Joined: 2010-08-28T11:16:00-07:00
- Authentication code: 8675308
- Location: Montreal, Canada
Re: (the new) -distort Resize method in PerlMagick?
'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
-----
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
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: (the new) -distort Resize method in PerlMagick?
My guess is that -distort resize is too new and has not yet been folded into Perlmagick
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: (the new) -distort Resize method in PerlMagick?
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.
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.

Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/