note 116416 added to imagick.distortimage
| From: | peter dot e dot lind at gmail dot com | Date: | Tue, 30 Dec 2014 08:55:11 +0000 |
| Subject: | note 116416 added to imagick.distortimage | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-201279@lists.php.net to get a copy of this message | ||
It is worth nothing that details on distorts as well as arguments can be found at http://www.imagemagick.org/Usage/distorts/ -
the PHP manual doesn't give much, if any, detail on arguments.
I found this very useful when I had to do a translated rotation on an image - i.e. rotating around a
point in the image that was not square in the center. This can be achieved by using distortImage
with Imagick::DISTORTION_SCALEROTATETRANSLATE like this:
$imagick = new Imagick('/path/to/image');
$args = array(
20, # x point to rotate around
20, # y point to rotate around
1, # scaling factor - 1 means no scaling
90, # angle to rotate
);
$imagick->setImageVirtualPixelMethod(Imagick::VIRTUALPIXELMETHOD_TRANSPARENT);
$imagick->distortImage(Imagick::DISTORTION_SCALEROTATETRANSLATE, $args, true);
Note that this type of distort takes from 1 to 7 arguments, depending on what you want to do exactly
- there is a lot of flexibility here.
----
Server IP: 72.52.91.14
Probable Submitter: 93.176.83.250
----
Manual Page -- http://php.net/manual/en/imagick.distortimage.php
Edit -- https://master.php.net/note/edit/116416
Del: integrated -- https://master.php.net/note/delete/116416/integrated
Del: useless -- https://master.php.net/note/delete/116416/useless
Del: bad code -- https://master.php.net/note/delete/116416/bad+code
Del: spam -- https://master.php.net/note/delete/116416/spam
Del: non-english -- https://master.php.net/note/delete/116416/non-english
Del: in docs -- https://master.php.net/note/delete/116416/in+docs
Del: other reasons-- https://master.php.net/note/delete/116416
Reject -- https://master.php.net/note/reject/116416
Search -- https://master.php.net/manage/user-notes.php