Image compositing using black/white mask and image

[quote]I looked into this a bit more.

It looks like the main thing to do is to change the SampleModel of the BufferedImage’s Raster so that there is a band for Alpha. The BufferedImage’s ColorModel would need to change too. The question is. Can you make these changes on a BufferedImage and the related classes to remap the data in the Raster? It would be great if you could do this without needing to copy image data around.
Incidentally, that would be the next step I would try… copy that mask to the alpha channel of another image when you first load it, then use the built-in AlpahComposite stuff as needed.
[/quote]
thats pretty much what was suggested right at the start of this Thread :wink:

Well not directly… The earlier talk was about manipulating the pixels manually to put the alpha channel into the foreground image. I was suggesting that, if there is a reason, it could be kept separate as the alpha channel of some different image. But when I look closer it seems that it won’t work that way either… since there is no way to give a third image as the alpha channel for the AlphaComposite stuff.

So nevermind :slight_smile: