Anyway, mspaint only supports bitmask transparency, i.e. either a pixel is 100% transparent or it is 100% visible. The java code you are using is probably loading this image with bitmask transparency.. you need to be using "translucent" transparency..

Loading an image with ImageIO usually does this automatically for you. This code shows the image correctly:

After you do that, useableImage will contain the image from the file but it will be TYPE_INT_ARGB, which will have "cleaner" alpha access.

Your code example assumes the pixels of the newly constructed BufferedImage are initialised to 0x00000000, an assumption you would expect to be safe. However as far as i'm aware the BufferedImage javadoc makes no such guarantee, and I know of atleast 1 Apple VM release that did not conform to this assumption. (it initialised the pixels to an opaque grey)

So for completeness you should set the compositing rule so as to only use the alpha component of the source. (see above quoted code)

Your code example assumes the pixels of the newly constructed BufferedImage are initialised to 0x00000000, an assumption you would expect to be safe. However as far as i'm aware the BufferedImage javadoc makes no such guarantee, and I know of atleast 1 Apple VM release that did not conform to this assumption. (it initialised the pixels to an opaque grey)

So for completeness you should set the compositing rule so as to only use the alpha component of the source. (see above quoted code)

BufferedImages are guaranteed to be initialized with 0s (even if the spec doesn't say it), they are backed by java arrays - at least in Sun implementation. I would bet that that Apple bug that had BIs initialized to gray (could you give a link to the report?) was pre-1.5, which is for all intended purposes long gone..

BufferedImages are guaranteed to be initialized with 0s (even if the spec doesn't say it), they are backed by java arrays - at least in Sun implementation. I would bet that that Apple bug that had BIs initialized to gray (could you give a link to the report?) was pre-1.5, which is for all intended purposes long gone..

Dmitri

It was indeed a looooong time ago - someone reported it as a bug against something i'd written, can't remember what it was, or even if it was on this forum! (might have been on the Sun forums)

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org