PHP | Imagick getImageBorderColor() Function
Last Updated :
20 Nov, 2019
The Imagick::getImageBorderColor() function is an inbuilt function in PHP which is used to get the image border color.
Syntax:
ImagickPixel Imagick::getImageBorderColor( void )
Parameters: This function does not accept any parameters.
Exceptions: This function throws ImagickException on error.
Return Value: This function returns an ImagickPixel set to the border color of the image.
Below programs illustrate the Imagick::getImageBorderColor() function in PHP:
Program 1:
<?php
$imagick = new Imagick(
$imagickPixelColor = $imagick ->getImageBorderColor();
$color = $imagickPixelColor ->getColorAsString();
echo $color ;
?>
|
Output:
srgb(223, 223, 223)
Program 2:
<?php
$imagick = new Imagick(
$imagick ->setImageBorderColor( 'brown' );
$imagickPixelColor = $imagick ->getImageBorderColor();
$color = $imagickPixelColor ->getColorAsString();
echo $color ;
?>
|
Output:
srgb(165, 42, 42)
Reference: https://www.php.net/manual/en/imagick.getimagebordercolor.php
Share your thoughts in the comments
Please Login to comment...