Skip to content
Related Articles
Open in App
Not now

Related Articles

PHP | Imagick labelImage() Function

Improve Article
Save Article
  • Last Updated : 12 Sep, 2019
Improve Article
Save Article

The Imagick::labelImage() function is an inbuilt function in PHP which is used to add label to an image.


bool Imagick::labelImage( string $label )

Parameters: This function accepts a single parameter $label which holds the label to add to the image.

Return Value: This function returns TRUE on success.

Errors/Exceptions: This function throws ImagickException on error.

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


// Create a new imagick object
$imagick = new Imagick(
// Adding the label to the image
$imagick->labelImage("This is my label.");
// Getting the label of the image
$labelInImage = $imagick->getImageProperties("label");
// Display the label of image
echo $labelInImage['label'];


This is my label.


My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!