PHP | ImagickPixel getColorQuantum() Function Last Updated : 17 Jan, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report The ImagickPixel::getColorQuantum() function is an inbuilt function in PHP which is used to get the color of the pixel in an array as Quantum values. This function returns an array with keys r, g, b and an each stands for red, green, blue and alpha/opacity respectively. Quantum value ranges from 0 to 65535 where 0 is the lowest value and 65535 is the highest value i.e, an opacity of 0 means transparent and 65535 means opaque. Syntax: array ImagickPixel::getColorQuantum( void ) Parameters: This function doesn’t accept any parameter. Return Value: This function returns an array containing the quantum values. Exceptions: This function throws ImagickException on error. Below given programs illustrate the ImagickPixel::getColorQuantum() function in PHP: Program 1: php <?php // Create a new imagickPixel object $imagickPixel = new ImagickPixel(); // Get the color quantum $colorQuantum = $imagickPixel->getColorQuantum(); print("<pre>".print_r($colorQuantum, true)."</pre>"); ?> Output: Array // which is the default value ( [r] => 0 [g] => 0 [b] => 0 [a] => 65535 ) Program 2: php <?php // Create a new imagickPixel object $imagickPixel = new ImagickPixel(); // Set the color $imagickPixel->setColor('#48c268'); // Get the color quantum $colorQuantum = $imagickPixel->getColorQuantum(); print("<pre>".print_r($colorQuantum, true)."</pre>"); ?> Output: Array ( [r] => 18504 [g] => 49858 [b] => 26728 [a] => 65535 ) Reference: https://www.php.net/manual/en/imagickpixel.getcolorquantum.php Comment More infoAdvertise with us Next Article PHP | ImagickPixel getColor() Function G gurrrung Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Imagick Similar Reads PHP | ImagickPixel getColorValueQuantum() function The ImagickPixel::getColorValueQuantum() function is an inbuilt function in PHP which is used to get the normalized value of the provided color channel for a given ImagickPixel's color. The normalized value lies in the quantum range where 65535 is maximum and 0 is lowest on contrary to getColorValue 2 min read PHP | ImagickPixel getColorCount() function The ImagickPixel::getColorCount() function is an inbuilt function in PHP which is used to get the color count associated with the pixel color. A color count is the number of pixels in the image that have the same color as this ImagickPixel. getColorCount() appears to only work for ImagickPixel objec 2 min read PHP | ImagickPixel getColor() Function The ImagickPixel::getColor() function is an inbuilt function in PHP which is used to get the color described by the ImagickPixel object, as an array. If the color has an opacity channel set, this is provided as a fourth value in the list. Keys of the array are r is (red), b is (blue), g is (green) a 2 min read PHP | ImagickPixel getColorValue() function The ImagickPixel::getColorValue() function is an inbuilt function in PHP which is used to get the normalized value of the provided color channel for a given ImagickPixel's color. The normalized value is a floating-point number between 0 and 1. Syntax: float ImagickPixel::getColorValue( int $color ) 1 min read PHP | GmagickPixel getcolorcount() Function The GmagickPixel::getcolorcount() function is an inbuilt function in PHP which is used to get the color count associated with the pixel color. A color count is the number of pixels in the image that have the same color as this GmagickPixel. The getcolorcount() appears to only work for GmagickPixel o 2 min read PHP | GmagickPixel getcolorvalue() Function The GmagickPixel::getcolorvalue() function is an inbuilt function in PHP which is used to get the normalized value of the provided color channel for a given GmagickPixel color. The normalized value is a floating-point number between 0 and 1. Syntax: float GmagickPixel::getcolorvalue( int $color ) Pa 2 min read Like