The solution may be as follows:
$colorIndex = imagecolorat($img, $x, $y); $colorInfo = imagecolorsforindex($img, $colorIndex); print_r($colorInfo);
which will print something like:
Array ( [red] => 226 [green] => 222 [blue] => 252 [alpha] => 0 )
where [alpha] is your transparency value ... (from 0 to 127, where 0 is the total opaque and 127 is completely transparent)
Enjoy it!
source share