Paint Program with Alpha Channel Support
-
I'm trying to edit some bitmaps with an alpha channel for a toolbar, and I need a program like Paint that comes with windows, but with support for an Alpha channel. I have downloaded several programs and checked them out, including Paint Shop Pro, and none will do the job so far. PSP doesn't seem to import/export the alpha channel of a simple .bmp file properly. Does anyone here have a program to suggest - I don't need any fancy features, just basic pixel editing and alpha... Ideas?
-
I'm trying to edit some bitmaps with an alpha channel for a toolbar, and I need a program like Paint that comes with windows, but with support for an Alpha channel. I have downloaded several programs and checked them out, including Paint Shop Pro, and none will do the job so far. PSP doesn't seem to import/export the alpha channel of a simple .bmp file properly. Does anyone here have a program to suggest - I don't need any fancy features, just basic pixel editing and alpha... Ideas?
AFAIK, BMP does not have official per-pixel alpha support. the 4th byte in a 32-bit BMP is "not used" according to MS's documentation for all versions of the BITMAPINFOHEADER. maybe MS is trying to sneak alpha into that 4th BYTE, but they're fighting against at least a decade of their own documentation that says it's "not used". a better bet would be to use PNG, TGA or TIFF which are at least intended to have true alpha channels. you're more likely to find real alpha support for those formats. Photoshop 6 has spotty alpha support for these, i hear v7 is better. -c
Chris Losinger
Smaller Animals Software -
AFAIK, BMP does not have official per-pixel alpha support. the 4th byte in a 32-bit BMP is "not used" according to MS's documentation for all versions of the BITMAPINFOHEADER. maybe MS is trying to sneak alpha into that 4th BYTE, but they're fighting against at least a decade of their own documentation that says it's "not used". a better bet would be to use PNG, TGA or TIFF which are at least intended to have true alpha channels. you're more likely to find real alpha support for those formats. Photoshop 6 has spotty alpha support for these, i hear v7 is better. -c
Chris Losinger
Smaller Animals SoftwareThe system provided toolbar images in XP common controls library definitely include an alpha channel, and the toolbars appear to be using the data. I need to rearrange some of the images in these bitmaps, but can't do it because every program I've found strips the alpha information, thereby destroying the mask. I don't really want to get involved in trying to use a different image format just for a toolbar bitmap.
-
The system provided toolbar images in XP common controls library definitely include an alpha channel, and the toolbars appear to be using the data. I need to rearrange some of the images in these bitmaps, but can't do it because every program I've found strips the alpha information, thereby destroying the mask. I don't really want to get involved in trying to use a different image format just for a toolbar bitmap.
Bletch wrote: The system provided toolbar images in XP common controls library definitely include an alpha channel, and the toolbars appear to be using the data I have not checked but are you sure those are not GIF or ICO files? Windows Bitmaps definitley do not support an alpha channel.
Paul Watson
Bluegrass
Cape Town, South Africabrianwelsch wrote: I find my day goes by more smoothly if I never question other peoples fantasies. My own disturb me enough.
-
The system provided toolbar images in XP common controls library definitely include an alpha channel, and the toolbars appear to be using the data. I need to rearrange some of the images in these bitmaps, but can't do it because every program I've found strips the alpha information, thereby destroying the mask. I don't really want to get involved in trying to use a different image format just for a toolbar bitmap.
yes, and you can use 32-bit DIBs with alpha info in some newer GDI and GDI+ calls. but, like I said, the MS documentation doesn't say that BMP supports per-pixel alpha - at least none that i've seen. and, i suspect that's why you'll have a hard time finding an editor with alpha support for BMP. -c
Chris Losinger
Smaller Animals Software -
yes, and you can use 32-bit DIBs with alpha info in some newer GDI and GDI+ calls. but, like I said, the MS documentation doesn't say that BMP supports per-pixel alpha - at least none that i've seen. and, i suspect that's why you'll have a hard time finding an editor with alpha support for BMP. -c
Chris Losinger
Smaller Animals SoftwareIn a 4bit (16 color) to 8bit (256 color) BMP image the last entry int the pallete is used as the background color which becomes transparent. Typically in a 24bit image the first pixel is used as the transparent pixel. Todd Smith
-
yes, and you can use 32-bit DIBs with alpha info in some newer GDI and GDI+ calls. but, like I said, the MS documentation doesn't say that BMP supports per-pixel alpha - at least none that i've seen. and, i suspect that's why you'll have a hard time finding an editor with alpha support for BMP. -c
Chris Losinger
Smaller Animals SoftwareHere are the first few bytes of the file, labeled with the names from MSDN, and the actual decimal value on the right. Note that the file is definitely a bitmap, and it is 32 bits (24 bits + alpha). bfType - 42 4D - "BM" bfSize - 36 BC 00 00 - 0x0000BC36 bfReserved1 - 00 00 - 0 bfReserved2 - 00 00 - 0 bfOffBits - 36 00 00 00 - 0x36 biSize - 28 00 00 00 - 0x28 biWidth - F0 02 00 00 - 752 bcHeight - 10 00 00 00 - 16 biPlanes - 01 00 - 1 biBitCount - 20 00 - 32 I didn't include it here, but the specified compression is 0 for none, so I'm not being confused by compressed data. The extra 8 bits are not just filler, either - here is a section of actual bitmap data further in the file (note that data is being provided for all 4 components): C3 FF 9E 9E pixel 9E EF 91 72 pixel 72 CF C5 AC pixel AC FF B5 B5 pixel Anyone who wishes to take a look, this from bitmap id 216 in the XP comctl32.dll version 6.0.2600.0
-
Bletch wrote: The system provided toolbar images in XP common controls library definitely include an alpha channel, and the toolbars appear to be using the data I have not checked but are you sure those are not GIF or ICO files? Windows Bitmaps definitley do not support an alpha channel.
Paul Watson
Bluegrass
Cape Town, South Africabrianwelsch wrote: I find my day goes by more smoothly if I never question other peoples fantasies. My own disturb me enough.
-
I'm trying to edit some bitmaps with an alpha channel for a toolbar, and I need a program like Paint that comes with windows, but with support for an Alpha channel. I have downloaded several programs and checked them out, including Paint Shop Pro, and none will do the job so far. PSP doesn't seem to import/export the alpha channel of a simple .bmp file properly. Does anyone here have a program to suggest - I don't need any fancy features, just basic pixel editing and alpha... Ideas?
I finally found one program that can do the job - Adobe Photoshop. Unfortunately, for my purposes its kind of like using a nuclear reactor to fry an egg, but at least it gets the job done. To answer some of the replies above, Photoshop opens the bitmap and does show alpha channel information for the image, and the best part is it allows the image to be saved as a bitmap with alpha channel intact.
-
Here are the first few bytes of the file, labeled with the names from MSDN, and the actual decimal value on the right. Note that the file is definitely a bitmap, and it is 32 bits (24 bits + alpha). bfType - 42 4D - "BM" bfSize - 36 BC 00 00 - 0x0000BC36 bfReserved1 - 00 00 - 0 bfReserved2 - 00 00 - 0 bfOffBits - 36 00 00 00 - 0x36 biSize - 28 00 00 00 - 0x28 biWidth - F0 02 00 00 - 752 bcHeight - 10 00 00 00 - 16 biPlanes - 01 00 - 1 biBitCount - 20 00 - 32 I didn't include it here, but the specified compression is 0 for none, so I'm not being confused by compressed data. The extra 8 bits are not just filler, either - here is a section of actual bitmap data further in the file (note that data is being provided for all 4 components): C3 FF 9E 9E pixel 9E EF 91 72 pixel 72 CF C5 AC pixel AC FF B5 B5 pixel Anyone who wishes to take a look, this from bitmap id 216 in the XP comctl32.dll version 6.0.2600.0
yup. i'm not saying you can't store alpha the data in a BMP file, in fact i do it in my own stuff, as well as using the 4th palette BYTE as a way to store and transmit per-pixel alpha info in colormapped images, but i never claim it's a standard or accepted thing to do. it's simply not an officially documented way to use a BMP file. look at the help for any of the BITMAPINFOHEADER flavors: 32: The bitmap has a maximum of 2^32 colors. If the biCompression member of the BITMAPINFOHEADER is BI_RGB, the bmiColors member is NULL. Each DWORD in the bitmap array represents the relative intensities of blue, green, and red, respectively, for a pixel. The high byte in each DWORD is not used.... that's why support for this is spotty. on the other hand, PNG, TIFF, TGA, etc. all have official alpha channel support, etc.. -c
Chris Losinger
Smaller Animals Software -
In a 4bit (16 color) to 8bit (256 color) BMP image the last entry int the pallete is used as the background color which becomes transparent. Typically in a 24bit image the first pixel is used as the transparent pixel. Todd Smith
Todd Smith wrote: In a 4bit (16 color) to 8bit (256 color) BMP image the last entry int the pallete is used as the background color which becomes transparent. yes, it can be used for that. it could also be used to hold any data at all. however, the docs for RGBQUAD clearly state: rgbReserved : Reserved; must be zero. Todd Smith wrote: Typically in a 24bit image the first pixel is used as the transparent pixel. that's a context-specific way of handling it. no paint program would ever do that. -c
Chris Losinger
Smaller Animals Software -
yup. i'm not saying you can't store alpha the data in a BMP file, in fact i do it in my own stuff, as well as using the 4th palette BYTE as a way to store and transmit per-pixel alpha info in colormapped images, but i never claim it's a standard or accepted thing to do. it's simply not an officially documented way to use a BMP file. look at the help for any of the BITMAPINFOHEADER flavors: 32: The bitmap has a maximum of 2^32 colors. If the biCompression member of the BITMAPINFOHEADER is BI_RGB, the bmiColors member is NULL. Each DWORD in the bitmap array represents the relative intensities of blue, green, and red, respectively, for a pixel. The high byte in each DWORD is not used.... that's why support for this is spotty. on the other hand, PNG, TIFF, TGA, etc. all have official alpha channel support, etc.. -c
Chris Losinger
Smaller Animals SoftwarePoint taken - your right about the docs. Apparently, however, in XP Microsoft has started using an alpha channel, but the docs aren't up to date as usual. They're actually using alpha channels a fair bit in XP, between toolbar images and icons (which are just a different flavor of bmp).
-
The system provided toolbar images in XP common controls library definitely include an alpha channel, and the toolbars appear to be using the data. I need to rearrange some of the images in these bitmaps, but can't do it because every program I've found strips the alpha information, thereby destroying the mask. I don't really want to get involved in trying to use a different image format just for a toolbar bitmap.
Generally, when BMP files are used for RGBA (red, green, blue, alpha) images, they include the alpha information in a separate file. This might be whats going on in the "system provided toolbar images". Bletch wrote: I need to rearrange some of the images in these bitmaps, but can't do it because every program I've found strips the alpha information, thereby destroying the mask. Are you sure the paint program is stripping the Alpha information, as opposed to the other possibility that you are opening the RGB bitmap and not realizing that the Alpha bitmap is in another file? ------------------------------------------ "What happened in that Rhode Island club is shocking. To think that over a hundred people would attend a Great White concert." - The Onion