32-Bit BMP with Alpha Channel has White Matte

SM
Posted By
Stan_Morris
Jul 29, 2004
Views
3249
Replies
4
Status
Closed
This appears to be a Photoshop defect. I am looking for a simpler workaround.

Photoshop stores 32-Bit BMPs with a white matte instead of retaining the original color information and varying the opacity. My application uses 32-Bit BMP with alpha channel transparency and the white-biased translucent pixles are obvious.

This defect is masked by an odd behavior of Photoshop; when loading a BMP with transparency, the transparent areas are filled with white. This behavior contrasts with loading the same image saved as PNG which correctly preserves transparency. If Photoshop were to correctly display a 32-Bit BMP, this defect would be easy to spot.

It isn’t easy to verify this defect because not many applications handle transparency in BMPs. While loading images with a dropshadows stored as 32-Bit BMPs using PS, my application shows a white halo around the drop shadow. I cannot work around this in my application because the original color information in the translucent areas is lost. Examining the BMP’s binary data, there is a "fade to white" as opacity drops.

My current workaround is:
– merge visible areas of an image with translucent areas – duplicate this merged layer
– duplicate and merge the duplicated layer to reduce the opacity of translucent areas until they are completely
opaque (12 times).
– move layer under the original merged layer
– Ctrl-Click (Command-Click) the original merged layer
– On channel palette, "Save selection as channel" – Enable new Alpha channel
– Save as 32-Bit BMP (A8R8G8B8 or X8R8G8B8 only makes a
difference in the BMP header)

A BMP saved this way still loads with a white background in Photoshop, but the underlying color of the multiple-merged layer is stored in the alpha blended pixels instead of fading to white. My application shows that the “white halo” is gone and anti-aliased edges and translucent areas display correctly.

If anyone would like a tool to verify that Photoshop saved 32-Bit BMP images have “white halos”, I can send a Windows App that demonstrates it. I would appreciate any input on a simpler way to workaround this or maybe the Preferences setting to “Disable White Mattes for A8R8G8B8 BMP images” that I overlooked.

– Stan

How to Master Sharpening in Photoshop

Give your photos a professional finish with sharpening in Photoshop. Learn to enhance details, create contrast, and prepare your images for print, web, and social media.

L
Litron
Jul 30, 2004
Not sure about a workaround – but the problem you’re describing usually happens when a multi-layered image (w/transparency) is saved to a format (such as bmp) that does not support transparency or layers – the layers are flattened and any transparent areas are converted to white.

Possible solution: save the file in a format such as GIF that supports transparency – or if you prefer a lossless format, save the file in the native PSD. Not sure about about multi-layered TIF’s – but they may support transparency as well.

—————————-
wrote in message
This appears to be a Photoshop defect. I am looking for a simpler
workaround.
Photoshop stores 32-Bit BMPs with a white matte instead of retaining the
original color information and varying the opacity. My application uses 32-Bit BMP with alpha channel transparency and the white-biased translucent pixles are obvious.
This defect is masked by an odd behavior of Photoshop; when loading a BMP
with transparency, the transparent areas are filled with white. This behavior contrasts with loading the same image saved as PNG which correctly preserves transparency. If Photoshop were to correctly display a 32-Bit BMP, this defect would be easy to spot.
It isn’t easy to verify this defect because not many applications handle
transparency in BMPs. While loading images with a dropshadows stored as 32-Bit BMPs using PS, my application shows a white halo around the drop shadow. I cannot work around this in my application because the original color information in the translucent areas is lost. Examining the BMP’s binary data, there is a "fade to white" as opacity drops.
My current workaround is:
– merge visible areas of an image with translucent areas – duplicate this merged layer
– duplicate and merge the duplicated layer to reduce the opacity of translucent areas until they are completely
opaque (12 times).
– move layer under the original merged layer
– Ctrl-Click (Command-Click) the original merged layer
– On channel palette, "Save selection as channel" – Enable new Alpha channel
– Save as 32-Bit BMP (A8R8G8B8 or X8R8G8B8 only makes a
difference in the BMP header)

A BMP saved this way still loads with a white background in Photoshop, but
the underlying color of the multiple-merged layer is stored in the alpha blended pixels instead of fading to white. My application shows that the "white halo" is gone and anti-aliased edges and translucent areas display correctly.
If anyone would like a tool to verify that Photoshop saved 32-Bit BMP
images have "white halos", I can send a Windows App that demonstrates it. I would appreciate any input on a simpler way to workaround this or maybe the Preferences setting to "Disable White Mattes for A8R8G8B8 BMP images" that I overlooked.
– Stan
JB
Jonathan_Balza
Jul 30, 2004
It’s my understanding that a .bmp such as the one you are describing (RGB 8bit + alpha) is just that. It DOES NOT store transparency, only the additional alpha channel. So when you save it out, the "white halo" is added by Photoshop to meet the specifications of that file format. Again: the "white halo" is a limitation of the file format, NOT Photoshop.

Now, about changing the matte color: If you were able to change the matte color that Photoshop replaces the transparency with, you would just get a black halo, or a green halo, etc… All in all, not much better than the white halo you are experiencing. So, your work-around is a correct way of dealing with these images, and it’s the way I would use – I don’t have any better ideas off-hand.

There’s nothing one can do to fix this "defect" in Photoshop.
JB
Jonathan_Balza
Jul 30, 2004
Oh yeah, and the whole "duplicate and merge the duplicated layer 12 times" step… You are using a Photoshop action for that step, right? It would make your life a whole lot easier.
CC
Chris_Cox
Aug 1, 2004
The BMP file format doesn’t support transparency at all – only a single unassociated alpha channel.

The PNG file format does support transparency – but not unassociated alphas.

Must-have mockup pack for every graphic designer 🔥🔥🔥

Easy-to-use drag-n-drop Photoshop scene creator with more than 2800 items.

Related Discussion Topics

Nice and short text about related topics in discussion sections