Set BufferedImage alpha mask in Java

I’m too late with this answer, but maybe it is of use for someone anyway. This is a simpler and more efficient version of Michael Myers’ method: public void applyGrayscaleMaskToAlpha(BufferedImage image, BufferedImage mask) { int width = image.getWidth(); int height = image.getHeight(); int[] imagePixels = image.getRGB(0, 0, width, height, null, 0, width); int[] maskPixels = … Read more