Page 1 of 1

Composite Displacement

Posted: 2017-11-12T06:17:27-07:00
by DenisFSC
Hi.

(command line) Code:

Code: Select all

composite displace_map.jpg label.jpg -displace 0x10 result.png
(command line) Result:
true
Image


(PHP) Code:

Code: Select all

$Displace = new Imagick("displace_map.jpg");
$Image = new Imagick("label.jpg");

$Image->compositeImage( $Displace, Imagick::COMPOSITE_DISPLACE, 0, 10);

$Image->writeImage("result.jpg");
(PHP) Result:
false
Image


Question:

How to get the same result in PHP?

Re: Composite Displacement

Posted: 2017-11-12T06:44:16-07:00
by snibgo
The x,y arguments to compositeIndex are for offsets. To set displacement values, use

Code: Select all

$Image->setImageArtifact('compose:args', "0x10");

Re: Composite Displacement

Posted: 2017-11-12T06:51:45-07:00
by DenisFSC
Thank you.
The problem is solved.