State of Development
Note that -affine/-transform was only completely fixed (at a gross level) as of two weeks ago. There is stil some work needed to ensure it is also fixed at the pixel offset level (EG: make sure half pixel displacements work as you would expect).
See IM examples for more info and examples on using...
http://www.imagemagick.org/Usage/distorts/#affine
There has been a suggestion that we have a setting that controls affine (and in the future perspective) transforms as to what size the result should be.
That is, a choice of...
- output fits transformed image (the current handling default)
output as original image (as positioned)
output as original image (no page offset)
output original image (centered)
given output size and offset (probably set with -size)
given ouput size and transformed image centered (as per -rotate and -scale)
However while this could speed things up by reducing the number of pixels that needs to be calculated, especially in extreme cases (for example rotating a very very long by thin image), all of these can be simply generated via some post-processing (with some pre-processing for the extreme cases).
The important point is that ALL the builtin distortions do not lose information, either image data, or from position changes, while keeping the resulting image at a minimal size.
Do you, or anyone else have any comment on the above?
The next aspect is to somehow merge -affine/-transform with a new -perspective distrotion operator.
A perspective distortion could be specified as a matrix of 8 values, and/or displacement of a quadrangle or 2x4coords or 16 values). However we are in need of a simplified perspective matrix inverse function, simular to what we have for affine matrix. See Affine Internals...
http://www.imagemagick.org/Usage/distorts/#affine_diy
We may even add some other methods of specifying an affine transform