在32位bmp上的透明度不执行任何操作

问题描述 投票:0回答:1

此32位bmp https://drive.google.com/open?id=1thySBsggtdihd3LByiAwQwZmVo1lzZfl具有透明性。但是由于某些原因,我的图像查看器/编辑器都不显示透明性。

我该如何修复此bmp?

image transparency bmp
1个回答
0
投票

您的BMP文件未正确编码以支持透明性。

根据following post

取决于压缩方法,默认的RGB方法支持24位颜色,但是BITFIELDS压缩支持32位颜色(24位+ alpha通道)。

根据Wikipedia:对于BI_BITFIELDS,标头地址1Eh的值应为3。地址36h3Ah3Eh42h值定义掩码:

36h 4 00 00 FF 00 00FF0000 Red channel bit mask (BI_BITFIELDS)3Ah 4 00 FF 00 00 0000FF00 Green channel bit mask (BI_BITFIELDS)3Eh 4 FF 00 00 00 000000FF Blue channel bit mask (BI_BITFIELDS)42h 4 00 00 00 FF FF000000 Alpha channel bit mask

您可以在线分析图像的元数据here

您的文件分析结果,压缩为File Name: BLUE_CLOSEBUTTON_BMP.bmpFile Size: 14 kB...Compression: None

您的BMP文件(位深为32位,但不透明):enter image description here


我使用GIMP保存具有透明度的BMP(使用GIMP创建)。

分析结果,压缩为位域

File Name: 1.bmpFile Size: 14 kBCompression: Bitfields...Red Mask: 0xff000000Green Mask: 0x00ff0000Blue Mask: 0x0000ff00Alpha Mask: 0x000000ff

这里是带有透明条纹的BMP(站点已将文件自动转换为PNG):enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.