If you only wish to extract the alpha value for a color, you can simply extract it like so:



<?php



$color = imagecolorat ( $im , 50 , 50 );

$alpha = $color >> 24 ;



?>



It actually shifts off the first 24 bits (where 8x3 are used for each color), and returns the remaining 7 allocated bits (commonly used for alpha)