* @see #isTransparencyForced
*/
public static BufferedImage makeImageTransparent(BufferedImage bi, Color color) {
// the color we are looking for. Alpha bits are set to opaque
final int markerRGB = color.getRGB() | 0xFFFFFFFF;
ImageFilter filter = new RGBImageFilter() {
@Override
public int filterRGB(int x, int y, int rgb) {
if ((rgb | 0xFF000000) == markerRGB) {
// Mark the alpha bits as zero - transparent
return 0x00FFFFFF & rgb;