Syntax:bool Imagick::labelImage (string $label)
Parameters:This function takes one parameter,
$label,which contains the label to add to the image.
Return value:this the function returns TRUE on success.
Errors / Exceptions:this function throws a
exceptionImagickException on error.The program below illustrates function Imagick::labelImage() in PHP:
Program:
// Create a new imagick object
$imagick
=
new
Imagick (
’ https://cdncontribute .engineerforengineer.org / wp-content / uploads / engineerforengineer-9.png ’
);
// Add a label to the image
$imagick
-> labelImage (
"This is my label."
);
// Get the image label
$labelInImage
=
$imagick
-> getImageProperties (
"label"
);
// Display the image label
echo
$labelInImage
[
’label’
];
?>
Output:This is my label.
Link: https : //www.php.net/manual/en/imagick.labelimage.php