This script is meant to work with the image3 addon. Its original function was to allow barrel distortion to be removed. However, some other simple transformations are also supported. In particular, transformations that rotate an image or distort a quadralateral into a rectangle are included. The quadralateral to rectangle feature can be used for the removal of tilt distortion.
It is recommended that the script be added to the image3 addon directory, and the help file be added to the help subdirectory of the image3 addon. To get started, load transform_image.ijs then run:
transform_image ''Alternately, a filename or image data may be given as an argument.
To remove barrel distortion:
Use shift-leftclick to select 3 points that should appear in a line. Then select the "transform"-"Remove Barrel Distortion" menus.
To rotate an image:
Use shift-leftclick to select two and then use menus to make the points fall on a horizontal or vertical line.
Alternately, select "transform"-"rotate by degrees" via menus and apply a suitable rotation.
To remove tilt distortion:
Select four points (use shift-leftclick) that should be the corners of a rectangle and use the "transform"-"tilt to rectangle" menus.
To balance sizes vertically or horizontally:
This is often useful after removing tilt. Select four points (use shift-leftclick) on a vertical or horizontal line that should be two segments of the same length. Use the "transform"-"balance Vertical(horizontal)" menus. If the aspect ratio is distorted in the resulting image, use the "transform"-"rescale" menu to adjust the aspect ratio.
To crop an image: Use left-mouse button to select a rectangular region. Select "transform"-"trim" from the menus.
To resize an image: Select "transform"-"resize" from the menus and indicate the new size (aspect ratio will be respected).
To rescale an image: Select "transform"-"rescale" from the menus and indicate the scale factors.