PHP | Gmagick getImageRenderingIntent() Function
Last Updated :
28 Aug, 2019
The Gmagick::getImageRenderingIntent() function is an inbuilt function in PHP which is used to get the image rendering intent.
Syntax:
int Gmagick::getImageRenderingIntent( void )
Parameters: This function does not accept any parameter.
Return Value: This function returns the rendering intent of image.
Below programs illustrate the Gmagick::getImageRenderingIntent() function in PHP:
Original Image 1:
Program 1:
<?php
$gmagick = new Gmagick(
$res = $gmagick ->getImageRenderingIntent();
echo ( $res );
?>
|
Output:
2
Original Image 2:
Program 2:
<?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' );
$res = $im ->getImageRenderingIntent();
echo "Before: " . $res . "</br>" ;
$im ->setImageRenderingIntent(8);
$res = $im ->getImageRenderingIntent();
echo "After " . $res ;
?>
|
Output:
Before: 2
After 8
Reference: http://php.net/manual/en/gmagick.getimagerenderingintent.php
Share your thoughts in the comments
Please Login to comment...