ImagickPixelIterator::clear

(PECL imagick 2, PECL imagick 3)

ImagickPixelIterator::clearClear resources associated with a PixelIterator

Description

publicImagickPixelIterator::clear(): bool
Warning

This function is currently not documented; only its argument list is available.

Clear resources associated with a PixelIterator.

Return Values

Returns true on success.

Examples

Example #1 ImagickPixelIterator::clear()

<?php
function clear($imagePath) {
$imagick = new \Imagick(realpath($imagePath));

$imageIterator = $imagick->getPixelRegionIterator(100, 100, 250, 200);


foreach ($imageIterator as $pixels) {


foreach ($pixels as $column => $pixel) {
if (
$column % 2) {

$pixel->setColor("rgba(0, 0, 0, 0)");
}
}

$imageIterator->syncIterator();
}

$imageIterator->clear();

header("Content-Type: image/jpg");
echo
$imagick;
}

?>
To Top