Here you can find the source of applyAlphaMask(BufferedImage buffer, BufferedImage alphaMask, int imgHeight)
private static void applyAlphaMask(BufferedImage buffer, BufferedImage alphaMask, int imgHeight)
//package com.java2s; //License from project: Apache License import java.awt.*; import java.awt.image.BufferedImage; public class Main { private static void applyAlphaMask(BufferedImage buffer, BufferedImage alphaMask, int imgHeight) { Graphics2D g2 = buffer.createGraphics(); g2.setComposite(AlphaComposite.DstOut); g2.drawImage(alphaMask, null, 0, imgHeight); g2.dispose();/*from ww w . ja v a 2 s. c om*/ } }