title: How to loop through all the pixels of an image?
body: <p>I want to loop through all the pixels of an image, find the rgba value of that pixel, and do something with those pixels.</p>
  
  <h2>Example</h2>
  
  <p>Say I have an image that's 100x100 pixels.  I want to find the value of each one of those pixels with the function I already made:</p>
  
  <pre><code>function getPixel($image, $x, $y) {
  
    $colors = imagecolorsforindex($image, imagecolorat($image, $x, $y));
    $inrgba = 'rgba(' . $colors['red'] . ',' . $colors['green'] . ',' . $colors['blue'] . ',' . $colors['alpha'] . ')';
    return $inrgba;
  }
  </code></pre>
  
  <p>And store those values, along with the dimensions of the image, in an array, or an array of arrays.  I want to use the end result in a html page.</p>
  
  <p>How do I do this?</p>