HomeImagickImagickDrawImagickPixelImagick Pixel IteratorImagick KernelTutorial Source codeReport an issue


← construct   destroy →
Clears the ImagickPixel object, leaving it in a fresh state. This also unsets any color associated with the object.

Honestly, doesn't do much useful. It appears to reset the colorspace setting of the ImagickPixel to sRGBColorspace and clear an internal exception setting. I'd recommend not using it.

function clear()
    $draw = new \ImagickDraw();

    $strokeColor = new \ImagickPixel('black');
    $fillColor = new \ImagickPixel();
    $fillColor->setColor('rgba(100%, 75%, 0%, 1.0)');


    $draw->rectangle(200, 200, 300, 300);

    $image = new \Imagick();
    $image->newImage(500, 500, "SteelBlue2");


    header("Content-Type: image/png");
    echo $image->getImageBlob();