PHP | Gmagick getquantumdepth() Function
Last Updated :
24 Jan, 2019
The Gmagick::getquantumdepth() function is an inbuilt function in PHP which is used to return the quantum depth of Gmagick object.
Syntax:
public Gmagick::getquantumdepth( void ) : array
Parameters: This function does not accept any parameter.
Return Value: This function returns the Gmagick quantum depth as string.
Below programs illustrate the Gmagick::getquantumdepth() function in PHP:
Program 1:
Original Image:
<?php
$im = new Gmagick(
print_r( $im ->getquantumdepth());
?>
|
Output:
Array ( [quantumDepthLong] => 16
[quantumDepthString] => Q16
)
Program 2:
Original Image:
<?php
$string = "Computer Science portal for Geeks!" ;
$im = new Gmagick();
$draw = new GmagickDraw();
$draw ->setFillColor( new GmagickPixel( 'green' ));
$draw ->setFontSize(50);
$metrix = $im ->queryFontMetrics( $draw , $string );
$draw ->annotation(0, 40, $string );
$im ->newImage( $metrix [ 'textWidth' ], $metrix [ 'textHeight' ],
new GmagickPixel( 'white' ));
$im ->drawImage( $draw );
$im ->setImageFormat( 'jpeg' );
print_r( $im ->getquantumdepth());
?>
|
Output:
Array ( [quantumDepthLong] => 16
[quantumDepthString] => Q16
)
Reference: http://php.net/manual/en/gmagick.getquantumdepth.php
Share your thoughts in the comments
Please Login to comment...