Pre-multiplying and alpha channels
Here's the problem: I would like to make a sprite that is blurry. I set up the BufferedImage with an alpha channel, draw my stuff, and then paint it over another image. That all works fine. Then when I blur it, I get some dark halo effects. I figured out that what I need to do is to put my sprite together without an alpha channel, and then convert white back to alpha, and I'll have a blurry sprite with alpha.
But I can't figure out how to do this. How do I convert a non-alpha image to an alpha image, with white getting converted to alpha? And is this the right way, or is there some way to pre-multiply the image (with alpha) do the blur and then un-premultiply?
Thanks for any dieas.
# 1
I ended up writing a Filter that does this. Seems like a lot of effort to be able to say, "draw a blurry line over something else", but I guess the Java Way is that the simple things are hard and the complex things are easy.
If there's one thing that's bad about Java, it's that there was no one sitting there and saying, "let's make a simple way to do the obvious stuff." Meanwhile over at Macromedia, when they were designing Flash, someone must have said, "of course people are going to want to make things blurry and draw them on top of other things", and there's probably a way to do that in Flash with a few clicks. In Java it takes writing some pretty complicated operations and understanding a lot of things about images to do this simple small thing.