Friday, October 17, 2025
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
32361 POSTS0 COMMENTS
Milvus
88 POSTS0 COMMENTS
Nango Kala
6728 POSTS0 COMMENTS
Nicole Veronica
11892 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11954 POSTS0 COMMENTS
Shaida Kate Naidoo
6852 POSTS0 COMMENTS
Ted Musemwa
7113 POSTS0 COMMENTS
Thapelo Manthata
6805 POSTS0 COMMENTS
Umr Jansen
6801 POSTS0 COMMENTS