If the input coordinates are in a straight line, the parameters in the forward direction are radically wrong.
For example (Windows BAT syntax):
Code: Select all
%IM%convert -size 7500x5000 gradient: sample.png
%IM%convert ^
-verbose ^
sample.png ^
-distort Affine "0,0,0,0 2000,2000,2490,2500 4000,4000,4999,4999" ^
a.png
Code: Select all
sample.png PNG 7500x5000 7500x5000+0+0 16-bit sRGB 90.6KB 0.906u 0:00.906
Affine Projection:
-distort AffineProjection \
'760152030403201.620000,-40008001603199.469000,-760152030403201.620000,400
08001603199.469000,0.000000,0.000000'
Affine Distort, FX Equivelent:
-fx 'ii=i+page.x+0.5; jj=j+page.y+0.5;
xx=+0.040008*ii +0.760152*jj +0.000000;
yy=+0.040008*ii +0.760152*jj +0.000000;
p{ xx-page.x-.5, yy-page.y-.5 }' \
sample.png=>a.png PNG 7500x5000 7500x5000+0+0 16-bit sRGB 632KB 24.078u 0:03.577
"-distort Perspective" has a similar problem, eg:
Code: Select all
F:\web\im>c:\im\ImageMagick-6.8.9-Q16\convert -verbose sample.png -distort
Perspective "0,0,0,0 1000,1000,1000,1000 2000,2000,2490,2500 4000,4000,4999,4999" a.png
sample.png PNG 7500x5000 7500x5000+0+0 16-bit sRGB 90.6KB 0.984u 0:00.985
Perspective Projection:
-distort PerspectiveProjection \
'43961906953.080711, -43961906952.112701, -2.333760, 7294679016.666127,
-7294679015.698006, -0.387245, 614769340.859532, -614769340.859599'
Perspective Distort, FX Equivelent:
-fx 'ii=i+page.x+0.5; jj=j+page.y+0.5;
rr=-0.016779*ii +0.016846*jj + 1;
xx=(-0.212195*ii +1.278808*jj -0.000000)/rr;
yy=(-0.212195*ii +1.278808*jj -0.000000)/rr;
rr>0 ? p{ xx-page.x-.5, yy-page.y-.5 } : blue' \