If this is a real distortion, that is including perspective transform, then it is not doable by an affine transform like skew/shear (which is available in LC Builder for paths/polygons), simply because a perspective transform is not affine.

TMHO, the best source for

**'distortion'** is in

imagemagick's documentation, describing also all the problems ...

**Skew/shear only for polygons.**
The formulas for shearing in x- or y-direction are

Code: Select all

```
-- p0 are the points of a polygon
-- b0 is the 'shear-factor', positive or negative, 0 is no shear
function shearX p0,b0
if b0=0 then return p0
put b0*pi/180 into b
repeat for each line L in p0
if L is empty then put CR & CR after p1
else put cr & (round(item 1 of L - b*item 2 of L),item 2 of L) after p1
end repeat
return char 2 to -1 of p1
end shearX
function shearY p0,b0
if b0=0 then return p0
put b0*pi/180 into b
repeat for each line L in p0
if L is empty then put CR & CR after p1
else put cr & (item 1 of L, round(item 2 of L + b*item 1 of L)) after p1
end repeat
return char 2 to -1 of p1
end shearY
```

See for an interactive example my

HTML5 demo ('Paul Klee clock').

**Skew/shear only for an image.**
Transform the imagedata as follows:

Determine the pixels of the image as points (x,y), transform them as above and set the color of the transformed pixels to the color of the originals.

LC will be not very fast with that (imageJIT 2.0, appearing in November will have that faster).

If you wish to have a skewed/sheared rectangle/polygon frame filled with an image you may use my

polygon widget -- adjust it manually in editMode or by setting the points by script (use functions above).

[p.s. You can ask support at runrev.com for a different forum-user name, if you like

]