my $image = GD::Image->new(1, 1); $image->colorAllocateAlpha(0, 0, 0, 127); # output follows #### unpack 'V', pack 'C4', 0, 0, 0, 127