Sometimes imagecolorat() returns 0 with some pixels in a PNG I’m analyzing. Why is that?
I looked the pixel and the color really is #111111. So it should return 1118481. Right?
I tried using imagealphablending($img,true) but I still get 0.
Thanks!
$img = @imagecreatefrompng($png);
if(!$img){
throw new Exception("Error loading PNG.");
}
var_dump(imagecolorat($img, 37, 625));
Result:
int 0
If image is loaded correctly and you get 0, then it means color is pure black (RGB => 0x000000 => 0)