Java Utililty Methods BufferedImage to Transparent

List of utility methods to do BufferedImage to Transparent

Description

The list of methods to do BufferedImage to Transparent are organized into topic(s).

Method

BufferedImagemakeTransparent(BufferedImage image, int x, int y)
make Transparent
ColorModel cm = image.getColorModel();
if (!(cm instanceof IndexColorModel))
    return image; 
IndexColorModel icm = (IndexColorModel) cm;
WritableRaster raster = image.getRaster();
int pixel = raster.getSample(x, y, 0); 
int size = icm.getMapSize();
byte[] reds = new byte[size];
...
voidmakeTransparent(BufferedImage img, Color trColor)
make Transparent
int w = img.getWidth();
int h = img.getHeight();
if (img.getType() != BufferedImage.TYPE_INT_ARGB) {
    return;
for (int x = 0; x < w; x++) {
    for (int y = 0; y < h; y++) {
        if (img.getRaster().getSample(x, y, 0) == trColor.getRed()
...
BufferedImagemakeTransparentEdges(BufferedImage src)
make Transparent Edges
return makeTransparentEdges(src, 0, null);