Please help me to count number of pixels in image, or put out the array of RGB.
So this is the script thet give me one element from array:
<?php
$img = "1.png";
$imgHand = imagecreatefrompng("$img");
$imgSize = GetImageSize($img);
$imgWidth = $imgSize[0];
$imgHeight = $imgSize[1];
echo '<img src="'.$img.'"><br><br>';
for ($l = 0; $l < $imgHeight; $l++) {
for ($c = 0; $c < $imgWidth; $c++) {
$pxlCor = ImageColorAt($imgHand,$c,$l);
$pxlCorArr = ImageColorsForIndex($imgHand, $pxlCor);
}
}
print_r($pxlCorArr);
?>
sorry for my english i from ukraine