Hi, i want to get color RGB from color sample, i wrote this:
<?php
//color sample file
$im = imagecreatefrompng("a.png");
$rgb = ImageColorAt($im, 1, 1);
$r = ($rgb >> 16) & 0xFF;
$g = ($rgb >> 8) & 0xFF;
$b = $rgb & 0xFF;
echo"R:$r G:$g B:$b";
?>
Outputs "R:0 G:0 B:0" but should be "R:128 G:58 B:100"? What is wrong?