▽1
●
TransFreeBSD ベストアンサー |
http://search.cpan.org/perldoc?Imager::Cookbook#Transparent_PNG
To make a transparent image, create an image object with 2 or 4 channels:
# RGB with alpha channel my $rgba = Imager->new(xsize => $width, ysize => $height, channels => 4); # Gray with alpha channel my $graya = Imager->new(xsize => $width, ysize => $height, channels => 2);By default, the created image will be transparent.
最後の行にあれっ?と思ったが、デフォルトのチャンネルは3、つまり透過を表すアルファチャンネルがないのは確か。
http://search.cpan.org/perldoc?Imager::ImageTypes#Creating_Imager_Objects
channels - The number of channels for the image. Default 3. Valid values are from 1 to 4.
たぶん、アルファチャンネル付きだと、作成時は全域が透過状態という意味なのでしょう。