Here is a quick hack at it...
<?php
//Get image
//May want to eventually set up a conditional to check file type automatically. This only supports png at the moment.
$im = imagecreatefrompng("php.png");
//Get height and width
list($width, $height, $type, $attr) = getimagesize("php.png");
//Loop through each spot
for($x = 0; $x < $width; $x++)
{
for($y = 0; $y < $height; $y++)
{
//Get the pixel
$rgb = imagecolorat($im, $x, $y);
//Change format -> #XXXXXX
$total = sprintf('#%02X%02X%02X', ($rgb >> 16) & 0xFF, ($rgb >> & 0xFF, $rgb & 0xFF);
echo "$x, $y = $total<br>";
}
}
?>
In action:
www.creativespeed.net/test.php
www.creativespeed.net/php.png
I really don't know how solid this is. Someone else can definitely sure it up.