how to count number of pixels in image (php)
<p>Please help me to count number of pixels in image, or put out the array of RGB.</p>

<p>So this is the script thet give me one element from array:</p>

<pre><code>&lt;?php
    $img = "1.png";
    $imgHand = imagecreatefrompng("$img");
    $imgSize = GetImageSize($img);
    $imgWidth = $imgSize[0];
    $imgHeight = $imgSize[1];
    echo '&lt;img src="'.$img.'"&gt;&lt;br&gt;&lt;br&gt;';
    for ($l = 0; $l &lt; $imgHeight; $l++) {
        for ($c = 0; $c &lt; $imgWidth; $c++) {
            $pxlCor = ImageColorAt($imgHand,$c,$l);
            $pxlCorArr = ImageColorsForIndex($imgHand, $pxlCor);
        }
    }


        print_r($pxlCorArr); 
?&gt;
</code></pre>

<p>sorry for my english i from ukraine</p>
