Open In App

PHP | Imagick getImageWhitePoint() Function

Last Updated : 26 Aug, 2019
Improve
Improve
Like Article
Like
Save
Share
Report

The Imagick::getImageWhitePoint() function is an inbuilt function in PHP which is used to get the chromaticity white point of an Imagick object.

Syntax:

bool Imagick::getImageWhitePoint( void)

Parameters: This function does not accept any parameter.

Return Value: This function returns the chromaticity white point as an associative array with the keys value x and y.

Below programs illustrate the Imagick::getImageWhitePoint() function in PHP:

Program 1:
Original Image:
https://media.geeksforgeeks.org/wp-content/uploads/geeks-21.png




<?php
  
// Craeate new imagic object
$imagick = new Imagick(
  
// Getting Length of image
// using getimagerelength function
$res = $imagick->getImageWhitePoint();
  
// Display result
print_r($res);
  
?>


Output:

Array ( [x] => 0.31270000338554 [y] => 0.3289999961853 ) 

Program 2:
Original Image:
https://media.geeksforgeeks.org/wp-content/uploads/Screenshot-from-2018-10-16-23-23-54.png




<?php 
  
$string = "Computer Science portal for Geeks!"
     
// Creating new image of above String 
// and add color and background 
$im = new Imagick(); 
$draw = new ImagickDraw(); 
    
// Fill the color in image 
$draw->setFillColor(new ImagickPixel('green')); 
    
// Set the text font size 
$draw->setFontSize(50); 
    
$metrix = $im->queryFontMetrics($draw, $string); 
$draw->annotation(0, 40, $string); 
$im->newImage($metrix['textWidth'], $metrix['textHeight'], 
              new ImagickPixel('white')); 
             
// Draw the image          
$im->drawImage($draw);
  
// getting Length of image
// using getimagerelength function
$res = $im->getImageWhitePoint();
  
// Display result
print_r($res);
  
?>


Output:

Array ( [x] => 0.31270000338554 [y] => 0.3289999961853 ) 

Reference: http://php.net/manual/en/imagick.getimagewhitepoint.php



Similar Reads

PHP | Gmagick getimagewhitepoint() Function
The Gmagick::getimagewhitepoint() function is an inbuilt function in PHP which is used to get the chromaticity white point as an associative array with the keys "x" and "y". Syntax: array Gmagick::getimagewhitepoint( void ) Parameters:This function doesn’t accepts any parameter. Return Value: This function returns an array value containing the chro
1 min read
PHP | Imagick floodFillPaintImage() Function
The Imagick floodFillPaintImage() Function is an in-built function in PHP which is used to change the color value of any pixel that matches the target, along with its immediate neighbor pixels of the same color. Note: This method is a replacement for deprecated Imagick::paintFloodFillImage() Function and is available if Imagick has been compiled ag
4 min read
PHP | Imagick adaptiveSharpenImage() Function
The Imagick::adaptiveSharpenImage() function is an inbuilt function in PHP which provides an adaptive sharpen image feature to the image. The intensity of an adaptive sharpen image depends on dramatically decreased at the edge of the image. Syntax: bool Imagick::adaptiveSharpenImage ( $radius, $sigma, $channel ) Parameters: This function accepts th
1 min read
PHP | Imagick flopImage() Function
The Imagick::flopImage() function is an inbuilt function in PHP which is used to create a horizontal mirror image. Syntax: bool Imagick::flopImage( void ) Parameters: This function does not accept any parameter. Return Value: This function returns True on success. Below programs illustrate the Imagick::flopImage() function in PHP: Program 1: Origin
1 min read
PHP | Imagick setImageExtent() Function
The Imagick::setImageExtent() function is an inbuilt function in PHP which is used to set the image size. This function doesn't scales the image but crops the unwanted parts. Syntax: bool Imagick::setImageExtent( int $columns, int $rows ) Parameters: This function accepts two parameters as mentioned above and described below: $columns: It specifies
1 min read
PHP | Imagick getCompressionQuality() Function
The Imagick::getCompressionQuality() function is an inbuilt function in PHP which is used to get the object compression quality. Syntax: int Imagick::getCompressionQuality( void ) Parameters: This function does not accept any parameters. Return Value: This function returns an integer value on success. Below programs illustrate the Imagick::getCompr
1 min read
PHP | Imagick clear() Function
The Imagick::clear() function is an inbuilt function in PHP which is used to clear all resource allocated to an Imagick object. Syntax: bool Imagick::clear( void ) Parameters: This function does not accept any parameter. It just clears off the resources of the Imagick object which is used to call the function. Return Value: This function returns tr
2 min read
PHP | Imagick annotateImage() Function
The Imagick::annotateImage() function is an inbuilt function in PHP which is used to annotates an image with text. This function returns True on success. Syntax: bool Imagick::annotateImage( $draw_settings, $x, $y, $angle, $text ) Parameters: This function accepts five parameters as mentioned above and described below: $draw_settings: This paramete
2 min read
PHP | Imagick adaptiveResizeImage() Function
The Imagick::adaptiveResizeImage() function is an inbuilt function in PHP which provides an adaptively resize image feature to the image. The intensity of an adaptive resize image depends on dramatically decreased at the edge of the image. This function is used to resize the image according to web sites. It is useful when it shrinks the images slig
1 min read
PHP | Imagick adaptiveBlurImage() Function
The Imagick::adaptiveBlurImage() function is an inbuilt function in PHP which is used to add adaptive blur filter in the given image. The intensity of an adaptive blur depends is dramatically decreased at the edge of the image, whereas a standard blur is a uniform across the image. This effect makes the image unclear or less distinct. Syntax: bool
2 min read