0
我想用文檔例如PHP imagick迭代器可以修改單獨的imagick修飾符嗎?
$imagick = new \Imagick(realpath($imagePath));
$imagick2 = clone $imagick;
$imageIterator = new \ImagickPixelIterator($imagick);
/* Loop through pixel rows */
foreach ($imageIterator as $pixels) {
/* Loop through the pixels in the row (columns) */
foreach ($pixels as $column => $pixel) {
/** @var $pixel \ImagickPixel */
if ($column % 2) {
/* Paint every second pixel black*/
$pixel->setColor("rgba(0, 0, 0, 0)");
} else {
//do something to $imagick2 here
$pixel->setColor("rgba(255, 255, 255, 0)");
}
}
/* Sync the iterator, this is important to do on each iteration */
$imageIterator->syncIterator();
這是可能的,並會語法是什麼樣子修改從相同的迭代器如2個imagick對象?