Transparency from BGR BufferedImages

I have a BGR BufferedImage and need a AGRB BufferedImage instead, how can I create one from it?

AGRB?

i’ve never heard of a colormodel using that format :S

perhaps u mean ARGB?

either way, the eziest (but not quickest) way is to create your new image, and copy the BGR image into it.

You might also be able to do it by grabbing the raster of the BGR image, and use that as the parameter for the new ARGB BufferedImage.
This should be ok, as both BGR and ARGB are integer packed.
Ofcourse, you will need to swap over the Red and Blue channels…

There may even be a simpler option… read around the BufferedImage and ColorModel classes, im sure you’ll find some useful method for converting between them :stuck_out_tongue:

cool, thanks