note 125815 added to imagick.distortimage
| From: | Abe@php.net | Date: | Sat, 13 Feb 2021 17:21:27 +0000 |
| Subject: | note 125815 added to imagick.distortimage | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-219300@lists.php.net to get a copy of this message | ||
Control Points for DISTORTION_PERSPECTIVE are pairs of x0, y0, x1, y1 coordinates, where x0/y0 is
the original point and x1/y1 is the destination point,
e.g. for a four point distortion:
<?php
$im = new imagick( $fn);
$w=$im->getImageWidth();
$h=$im->getImageHeight();
$im->setImageFormat('png');
$controlPoints = array(
$tLx, $tLy, 0, 0, // top left
$tRx, $tRy, $w, 0, // top right
$bRx, $bRy, $w, $h, // bottom right
$bLx, $bLy, 0, $h // bottom left
);
/* Perform the distortion */
$im->distortImage(Imagick::DISTORTION_PERSPECTIVE, $controlPoints, false);
// Output the image
$output = $im->getimageblob();
$outputtype = $im->getFormat();
header("Content-type: $outputtype");
echo $output;
?>
----
Server IP: 45.112.84.4
Probable Submitter: 45.112.85.246 (proxied: 2a02:c7f:dc2e:9000:fd8b:d01:a564:fb19)
----
Manual Page -- http://php.net/manual/en/imagick.distortimage.php
Edit -- https://master.php.net/note/edit/125815
Del: integrated -- https://master.php.net/note/delete/125815/integrated
Del: useless -- https://master.php.net/note/delete/125815/useless
Del: bad code -- https://master.php.net/note/delete/125815/bad+code
Del: spam -- https://master.php.net/note/delete/125815/spam
Del: non-english -- https://master.php.net/note/delete/125815/non-english
Del: in docs -- https://master.php.net/note/delete/125815/in+docs
Del: other reasons-- https://master.php.net/note/delete/125815
Reject -- https://master.php.net/note/reject/125815
Search -- https://master.php.net/manage/user-notes.php