Re: alpha channel

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



1) Save the bitmap uncompressed(i.e., BI_RGB) with the alpha channel
pre-multiplied against the other three color channels.

Unfortunately, it seems that BMP files saved by tools such as Paintshop or
Adobe photoshop do not save with pre-multiplied data.

Ive never seen an offiical word from MS, but it seems standard that BMP
files are not pre-multiplied.

"Michael Phillips, Jr." <mphillips53@xxxxxxxxxxxxxxx> wrote in message
news:eIzhoLk9HHA.5980@xxxxxxxxxxxxxxxxxxxxxxx
How can i get rid of this grey color and change it transparent alpha
channel?

Assuming that you wish to save this bitmap as 32bpp, you would need to
mark each grey color pixel as transparent by setting the alpha byte to 0.

Each opaque pixel should be marked as opaque with 0xff(i.e., 255) in the
apha channel byte.

You have two choices to save as a bitmap:

1) Save the bitmap uncompressed(i.e., BI_RGB) with the alpha channel
pre-multiplied against the other three color channels.
2) Save the bitmap with version 5.0 of the BITMAPINFOHEADER(i.e.,
BITMAPV5HEADER) which allows you to specify masks for the ARGB channels.

Using gdiplus allows you to set the alpha channel all at once with a
ColorMatrix. If you do not want to use gdiplus, then you must do the work
yourself in a loop for each scanline and each ARGB pixel.

If you do not want to do any work at all, then simply save the bitmap and
display it with MaskBlt or BitBlt. You would define the grey color as
transparent and create XOR color and AND mask for display purposes.

"Peter Lakatos" <news@xxxxxxx> wrote in message
news:OM80Q4j9HHA.5360@xxxxxxxxxxxxxxxxxxxxxxx
Hi,

i can create bitmaps with transparency, and with BitBlt they appear
transparent on my application.
In my case, i have a white Bitmap with a red box. i can create a
transparent Bitmap
out of it, and on the grey CDC there appears a red box.

But how can i get the Transparent Bitmap out of my CDC ?

I already was able to create a Bitmap out of the CDC but it always show
the grey background of the application with a red box.

How can i get rid of this grey color and change it transparent alpha
channel ?

Thank you all


.



Relevant Pages

  • Re: alpha channel
    ... Pre-multiplying normalizes that intensities of the colors in each channel. ... You will see that multiplying a transparent alpha byte of 0 against each ... Save the bitmap uncompressed ...
    (microsoft.public.win32.programmer.gdi)
  • Re: alpha channel
    ... None of Microsoft's bitmap encoders, including the new WIC component will ... and above to scan the pixels to determing if a usefull alpha channel exists. ... mark each grey color pixel as transparent by setting the alpha byte to 0. ...
    (microsoft.public.win32.programmer.gdi)
  • Re: alpha channel
    ... alpha channel - does it do a pre-multiplication then or does it expect the ... None of Microsoft's bitmap encoders, including the new WIC component will ... it will use it to display 32bpp alpha channel bitmaps and icons on ...
    (microsoft.public.win32.programmer.gdi)
  • Re: alpha channel
    ... Assuming that you wish to save this bitmap as 32bpp, ... each grey color pixel as transparent by setting the alpha byte to 0. ... apha channel byte. ...
    (microsoft.public.win32.programmer.gdi)
  • Re: UI design for Tk app--PNGs or GIFs for icons?
    ... transparent or it isn't), so there can't be any real anti-aliasing ... pixel to be anywhere between fully transparent and fully opaque, ... PNGs support up to 65535 colors per *channel*, ...
    (comp.lang.tcl)