I want to apply the alpha mask which is there in the image data. i have images of different formats namely tiffs,PSD PNGand jpeg.I am reading them as bufferedimage, and want to use the Twelvemonkeys lib to get the alpha paths configured in the images, and apply the transperency accordingly. But i can't find the relevant functions. Please help.
ImageInputStream stream = ImageIO.createImageInputStream(new File(c:/img.psd);
BufferedImage image = Paths.readClipped(stream);
image.getcoclormodel().hasAlpha();
for(i < image.getwidth()) {
for(j < image.getHeight()) {
pixels = image.getRGB(i, j, width, height, null, 0, width);
Color col = new Color(pixels[pixelIndex]);
int p = col.getAlpha()
image.setRGB(i, j, width, height, p, 0, width)
}
}