There are two different approaches used by graphic file formats for supporting transparent image areas: simple binary transparency and alpha transparency. Simple binary transparency is supported in the GIF format; one color from the indexed color palette is marked as the transparent color. Alpha transparency is supported in the PNG format; the transparency information is stored in a separate channel, the Alpha channel.
注意 | |
---|---|
GIF 格式很少使用,因为 PNG 支持 GIF 的所有功能以及附加功能(例如,alpha 透明度)。尽管如此,GIF 仍然用于动画。 |
过程 6.1. 创建具有透明区域(Alpha 透明度)的图像
首先,我们将使用与之前教程中相同的图像,即 GIMP 吉祥物 Wilber。
要导出具有 Alpha 透明度的图像,您必须具有 Alpha 通道。要检查图像是否具有 Alpha 通道,请转到通道对话框并验证除了红色、绿色和蓝色,名为“Alpha”的条目是否存在。如果不是这种情况,请从图层菜单中添加一个新的 Alpha 通道; + → 。
原始 XCF 文件包含您可以删除的背景层。GIMP带有支持创建渐变的标准滤镜;查看
+ 。你只受你的想象力的限制。为了演示 alpha 透明度的功能,在 Wilber 周围背景中显示了柔和光晕。After you're done with your image, you can export it in PNG format.