How to convert 32-bit BMP to contain alpha channel? [closed]

[亡魂溺海] 提交于 2019-11-30 08:43:26

pixelformer says that it can do it http://www.qualibyte.com/pixelformer/#color_depths

You can use PixelFormer.

If you use ULW_ALPHA on UpdateLayeredWindow() & LoadImage(), the function expect the BMP file need to be 32-bit BGRA (with Premultiplied Alpha & Down-Top row order) other than that the function will not display bitmap correctly.

You can convert PNG to BMP 32-bit BGRA with PixelFormer (step 2).

  1. Open PixelFormer and click File > New:

  1. Then File > Export

P.S.:

Photoshop have broken support when exporting bmp with alpha channel (it can't do premultiply alpha, alpha channel value will become 0). You'll lose alpha channel but the BGR value will load correctly. You can still use Photoshop but must manually draw alpha on alpha channel tab.

Gimp also have broken support, when you export as bmp. LoadImage() will not load anything and you can't see the image. I suspect this problem caused by Gimp exporting BMP as Top-Down row order.

Visual Studio resource editor also have option to create/edit 32bpp BGR but doesn't support alpha channel

I once needed to do the same thing and wrote a small command line tool which can be found here.

Opersource softwares - ImageMagic or Gimp can also be used for this image conversion.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!