Wednesday, June 17, 2026
HomeLanguagesPHP | Imagick deleteImageArtifact() Function

PHP | Imagick deleteImageArtifact() Function

The Imagick::deleteImageArtifact() function is an inbuilt function in PHP which is used to delete the image artifact. The main difference between image properties and image artifacts is that properties are public whereas artifacts are private.

Syntax:

bool Imagick::deleteImageArtifact( string $artifact )

Parameters: This function accepts a single parameter $artifact which holds the name of artifact.

Return Value: This function returns TRUE on success.

Errors/Exceptions: This function throws ImagickException on error.

Below program illustrates the Imagick::deleteImageArtifact() function in PHP:

Program:




<?php
  
// Create a new Imagick object
$imagick = new Imagick(
  
// Apply the setImageArtifact() function to create a artifact
$imagick->setImageArtifact("artifact_name", "artifact_value");
  
// Apply the deleteImageArtifact() function to delete a artifact
$imagick->deleteImageArtifact("artifact_name");
  
?>


Output:

A Database Error Occurred

Reference: https://www.php.net/manual/en/imagick.getimageartifact.php

RELATED ARTICLES

Most Popular

Dominic
32516 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6897 POSTS0 COMMENTS
Nicole Veronica
12014 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12109 POSTS0 COMMENTS
Shaida Kate Naidoo
7019 POSTS0 COMMENTS
Ted Musemwa
7262 POSTS0 COMMENTS
Thapelo Manthata
6976 POSTS0 COMMENTS
Umr Jansen
6964 POSTS0 COMMENTS