Imagick::setImageArtifact
PHP function
Edit on GitHub ✎
(PECL imagick 3)
Set image artifact
Description
Imagick::setImageArtifact(string $artifact, string $value): bool
Associates an artifact with the image. The difference between image properties and image artifacts is that properties are public and artifacts are private. 0x657
Parameters
artifactThe name of the artifact
valueThe value of the artifact
Return Values
Success
Errors/Exceptions
Throws
Examples
php
<?php
function setImageArtifact() {
$src1 = new \Imagick(realpath("./images/artifact/source1.png"));
$src2 = new \Imagick(realpath("./images/artifact/source2.png"));
$src2->setImageVirtualPixelMethod(\Imagick::VIRTUALPIXELMETHOD_TRANSPARENT);
$src2->setImageArtifact('compose:args', "1,0,-0.5,0.5");
$src1->compositeImage($src2, Imagick::COMPOSITE_MATHEMATICS, 0, 0);
$src1->setImageFormat('png');
header("Content-Type: image/png");
echo $src1->getImagesBlob();
}
?>