Thursday, July 30, 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

2 COMMENTS

Most Popular

Dominic
32520 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6903 POSTS0 COMMENTS
Nicole Veronica
12017 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12115 POSTS0 COMMENTS
Shaida Kate Naidoo
7023 POSTS0 COMMENTS
Ted Musemwa
7265 POSTS0 COMMENTS
Thapelo Manthata
6981 POSTS0 COMMENTS
Umr Jansen
6973 POSTS0 COMMENTS