PHP | Imagick labelImage() Function
Last Updated :
12 Sep, 2019
The Imagick::labelImage() function is an inbuilt function in PHP which is used to add label to an image.
Syntax:
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:
Program:
<?php
$imagick = new Imagick(
$imagick ->labelImage( "This is my label." );
$labelInImage = $imagick ->getImageProperties( "label" );
echo $labelInImage [ 'label' ];
?>
|
Output:
This is my label.
Reference: https://www.php.net/manual/en/imagick.labelimage.php
Share your thoughts in the comments
Please Login to comment...