Different results between Imagick and ImageMagick.

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
sabater_wb

Different results between Imagick and ImageMagick.

Post by sabater_wb »

Hello.
Something wrong is happening when running the following codes:

exec("D:/magick/convert $foto -distort Perspective \"0,0,$ax,$ay 0,$minheight,$bx,$by $minwidth,0,$cx,$cy $minwidth,$minheight,$dx,$nem \" testa2.jpg");

------------------------------

$controlPoints = array(0,0,$ax,$ay, 0,$minheight,$bx,$by, $minwidth,0,$cx,$cy, $minwidth,$minheight,$dx,$nem);

$im = new Imagick($foto);
$im->setImageMatte(true);
$im->distortImage(Imagick::DISTORTION_PERSPECTIVEPROJECTION, $controlPoints, true);

$im->writeImage("testa.jpg");
$im->destroy();

I thing that the result should be the same, but it isn't.
Take a look.

ImageMagick
Image

Imagick Result
Image

What is wrong with my code?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Different results between Imagick and ImageMagick.

Post by fmw42 »

I don't know if this is relevant, but some time ago, command line IM changed the ordering of the control points. Perhaps IMagick did not conform or you are using two different versions of IM. see http://www.imagemagick.org/Usage/distor ... rol_points. see also the comment about image coordinates vs pixel coordinates. Perhaps you are getting one of each.

Otherwise, post this to the IMagick forum viewforum.php?f=18
Post Reply