I’ve been programming for a long time, but just recently back to Java (since I left it in 1.1 4-5 years ago). Anyway, I’ve figured out the bulk of stuff in J2D, except for one thing:
Is there any canned way to load a separate file (or separate part of the same file) as the alpha channel of another? Say that I have 2 jpg files – one which contains an image, and one which contains the mask of that image… is there an easy way to use the mask image as the alpha channel of the original? I can write the function myself (it wouldn’t even be that hard to do – just pull in both files, and then transfer the grayscale mask image pixel-by-pixel as the alpha channel of the original image), but it seems like it would be extremely slow.
Keep in mind that I know I can use image formats such as GIF (which I don’t want to use due to the color depth) or PNG, which contain their own alpha information, but I wanted to know if there would be an easy way to get this to work (if for no other reason than to have all of my options open).
Thanks,
Chris