fmw42 wrote:Anthony has built into the -distort viewport the ability to do fx computations.
Add to the above
-filter point
This ensures that only fast and exact single point lookups are performed for that for a NO-OP distort (like
-distort SRT 0).
NOTE that the 2-dimentional EWA resampling while producing the best posible result we can get for general distortions, does mix a pixels color with its neighbours in the NO-OP case. It is minimal but default, but using
-filter point will turn of EWA resampling, switching to faster interpolative sampling. This have been the cause of some intensive study and discussion in the
Digital Image Processing forum.
Also note that
-interpolate nearest-neighbour interpolation should be fastest lookup, though at that level it should not make a great difference, and I have not don't any speed tests on interpolation, or even against area resampling. That may be a good new topic for the
Digital Image Processing forum.
For a special color surrounding the 'distorted image' result, use one of the other
-virtual-pixel settings (edge is the default!). See IM examples...
http://www.imagemagick.org/Usage/misc/#virtual
I have added an actual example of doing this in...
http://www.imagemagick.org/Usage/distor ... t_viewport
The use of Percent Escapes to 'geometry' style arguments will be added to IMv7 (in alpha development).It is one of the major new features planned for IMv7 Shell API, and one that should be of great benefit. This means eventually you can do this image bounds resize directly using
IMv7 -extent, and avoid the distort resampling issue.