HomeImagickImagickDrawImagickPixelImagick Pixel IteratorImagick KernelDevelopmentTutorial Source codeReport an issue
Category
Example

ImagickPixel::getColorQuantum

← getColor   getColorAsString →
Returns the color of the pixel in an array as Quantum values. If ImageMagick was compiled as HDRI these will be floats, otherwise they will be integers.
Gets the values of the different color channels of an ImagickPixel object, in the range 0 to Imagick::getQuantum() aka 0 to 65535 on this computer.
Create an ImagickPixel with the predefined color 'brown' and set the color to have an alpha of 25%

Values

r : 42405.0
g : 10794.0
b : 10794.0
a : 16383.75

Example

$color = new \ImagickPixel('brown');
$color->setColorValue(\Imagick::COLOR_ALPHA, 0.25);
$output .= "<h4>Values</h4>";
foreach ($color->getColorQuantum() as $key => $value) {
    $output .= "$key : " . var_export($value, true) . " <br/>";
}