Page 1 of 1

Blurry Perspective

Posted: 2017-02-08T01:52:38-07:00
by tolek
Hi,

I have a problem with DISTORTION_PERSPECTIVE for some images I got blurry efect like here:
http://nkontent.pl/imagick/pic.jpg

I tried many different ways to avoid this bug, but still same issue.
Maybe Im doing something wrong?

My code is:

$h = $img->getImageHeight();
$w = $img->getImageWidth();

$img->setImageMatte(true);

$r = 0;
$pers = 20;
$k = $w * $pers * 0.01;

$controlPoints = array(
0, 0, 0, 0,
0, $h, 0, $h,
$w, $r, $w, $k,
$w, $h, $w, $h - $k);

$img->distortImage(Imagick::DISTORTION_PERSPECTIVE, $controlPoints, true);

Re: Blurry Perspective

Posted: 2017-02-08T07:31:16-07:00
by snibgo
I have moved this to the Users forum.

The "blurry effect" in triangles at the top and bottom are from virtual pixels. Output pixels in these areas come from outside the input image. By default, pixels from the edge are used, hence the smearing effect. Set virtual pixels to black, or one of the other settings.