|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2016-02-04 18:22 UTC] lee dot traynor at skeptic dot de
Description: ------------ --- From manual page: http://www.php.net/imagick.compositeimage --- The script produces only black images regardless of the values passed by setImageArtifact. imagick module version 3.4.0RC6 Imagick compiled with ImageMagick version ImageMagick 6.8.9-1 Q16 x86 2014-05-08 http://www.imagemagick.org Test script: --------------- $im1 = new Imagick (realpath ("Waikare.jpg")); $im2 = clone $im1; $im1->setImageVirtualPixelMethod (Imagick::VIRTUALPIXELMETHOD_TRANSPARENT); $im1->setImageArtifact ("compose:args", "1,0,-0.5,0.5"); $im1->compositeImage ($im2, Imagick::COMPOSITE_MATHEMATICS, 0, 0); $im1->writeImage (getcwd () . "/test.png"); echo "<img src=\"test.png\">"; Expected result: ---------------- Using the values 0,1,-1,0.5 a grey image should be produced. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 20:00:01 2025 UTC |
I think setting the compose:args on the second image, gives the expected result: $im2->setImageArtifact ("compose:args", "1,0,-0.5,0.5"); Can you confirm?That seems to work fine as in this script to emulate grain extract layer mode: $im = new Imagick (realpath ("Paihia_Sunset.jpg")); $ge = clone $im; $ge->modulateImage (100, 0, 100); $ge->blurImage (0, 15); $ge->setImageArtifact ("compose:args", "0,-1,1,0.5"); $im->compositeImage ($ge, Imagick::COMPOSITE_MATHEMATICS, 0, 0); Note that the two values in the middle apply to $ge (-1) and $im (+1) respectively. This is difficult to see from the imagemagick command line because the images have to be swapped. If you were correcting the documentation, then the line about the virtual pixels can be removed. Perhaps that will make it clearer that the artifact has to be set on the composited object. Finally why in a lot of the Imagick examples is Imagick written with a backslash in front of it? I've never found it necessary to escape "i" and "\i" has no particular significance. It just makes the examples harder to follow. Best, Lee