Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
I'm currently trying to use ImageMagick to mass-convert a bunch of 32-bit ARGB BMP's that were generated by a C source file into PNG's, simply because the transparencies for BMP's don't work in Java. (I then learned that they don't usually work anywhere.)
but the image that comes out has white where transparency should be. I've also tried the "-alpha on" and "-alpha copy" options, and they come with the same result.
Why is this the case? Is there an option that I'm missing? I've searched the rest of the forums and the stuff that I found doesn't seem to help.
What version of IM are you using? I seem to recall there might have been an update for ARGB BMP not too long ago?
From the changelog:
2009-04-25 6.5.1-9 Cristy <quetzlzacatenango@image...>
Generate BMP 32-bit ARGB format for images with transparency (reference viewtopic.php?f=3&t=13633).
And I'm not trying to generate the BMP's, I'm trying to read them and keep the alpha while converting. (I generated them using a C++ file that split them from a GIMP ARGB image, if that helps.)
fmw42 wrote:There is no alpha channel in this image.
So that leaves me wondering why GIMP reads the first 8 bits of the 4-byte word as an alpha channel. (And I can't really convert the white because some of the pixels are already ffffff, and I don't want to sift through almost 3000 images looking for a few dead pixels.)
I am on a Mac. If I open it in Photoshop CS (old), Debabelizer or Preview, it does not show an alpha channel. but if I open it in GraphicConverter, it shows as 24-bit rgb with 8-bit alpha.
So I would say that there is some issue with this format that so many readers do not recognize it properly including IM.
I would pass this on to the Bugs forum and have the IM folks check it out.
fmw42 wrote:I would pass this on to the Bugs forum and have the IM folks check it out.
Alright. I did some more research and it turns out that ARGB32 isn't quite a standard with BMP's yet. But I'll check with the IM people and see if they can do anything about it. (Perhaps another option under the formats?)
fmw42 wrote:I would pass this on to the Bugs forum and have the IM folks check it out.
Alright. I did some more research and it turns out that ARGB32 isn't quite a standard with BMP's yet. But I'll check with the IM people and see if they can do anything about it. (Perhaps another option under the formats?)
I've looked at the sample file. It has a standard V3 bitmap header with the biBitCount field set to 32. The documentation that comes with my Microsoft compiler says that when biBitCount is 32, the remaining image data is formatted like this:
"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."
i.e. there is no alpha channel even though there's room for it.
Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
el_supremo wrote:i.e. there is no alpha channel even though there's room for it.
So would the solution be to use a V4 or V5 header, which does create an alpha channel? (and if even those don't create it, I wouldn't know what. According to Wikipedia, there has been an ARGB32 standard since Windows XP, but I have no idea how to use it.)