Php ImageColorAt不从ImageCreateTureColor返回alpha

Php ImageColorAt不从ImageCreateTureColor返回alpha,php,gd,Php,Gd,尝试进行一些图像处理时,我发现imagecreatetruecolor()似乎只有24位。我通过imagecopyresampled()所需的动作来保留图像中的alpha $bottles = imagecreatefrompng("bottles.png"); $output = imagecreatetruecolor(32, 32); imagecolortransparent($output, imagecolorallocatealpha($output, 0, 0

尝试进行一些图像处理时,我发现
imagecreatetruecolor()
似乎只有24位。我通过
imagecopyresampled()
所需的动作来保留图像中的alpha

$bottles = imagecreatefrompng("bottles.png");
$output = imagecreatetruecolor(32, 32);
imagecolortransparent($output, imagecolorallocatealpha($output, 0, 0, 0, 127));
imagealphablending($output, true);
imagesavealpha($output, false);
imagecopyresampled($output, $bottles, 0, 0, $type*32, 32, 32, 32, 32, 32);
生成的图像如下所示:

然后我想做一些特殊的操作,需要知道每个像素的alpha通道,但是当我执行以下操作时:

for($y = 0; $y < 32; $y++)
{
    for($x = 0; $x < 32; $x++)
    {
        $c = imagecolorat($output, $x, $y);
        $rgb = imagecolorsforindex($output, $c);
        echo $c."\n";
        print_r($rgb);
($y=0;$y<32;$y++)的

{
对于($x=0;$x<32;$x++)
{
$c=imagecolorat($output,$x,$y);
$rgb=imagecolorsforindex($output,$c);
echo$c.“\n”;
印刷品(rgb);
$c
返回图片中没有颜色的所有部分(或者在该透明度下仍然有白色的所有部分)的
16777215
,以及
$rgb[“alpha”]
显示零。但是,如果我将
$output
更改为
$labels
,则
$c
返回
2130706432
。这看起来更像一个32位数字,实际上
$rgb[“alpha”]
显示各种数字

因此,如果
imagecolorat()
没有从
imagecreatetruecolor()
返回alpha值,我如何找到它的alpha值?我已经在
imagecolorat()之前更改了
imagealpha混合()
imagesavealpha()
组合(真+真,真+假,假+真,假+假)
但它仍然返回一个24位数字