Java Utililty Methods BufferedImage Transparent

List of utility methods to do BufferedImage Transparent

Description

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

Method

voidsetTranformImagePixels(BufferedImage origImg, Color paramColor, int colorRangePerc, Vector transPixel, Shape cutoutShape)
set Tranform Image Pixels
if (transPixel == null)
    throw new NullPointerException("Transformation Pizel is Null");
int maxCols = origImg.getWidth(), maxRows = origImg.getHeight();
GeneralPath cutoutPath = null;
int startx = 0, starty = 0;
if (cutoutShape != null) {
    cutoutPath = new GeneralPath(cutoutShape);
    Rectangle pathBounds = cutoutPath.getBounds();
...
BufferedImagetransparentBG(BufferedImage image, Boolean transparent)
Returns the same image with transparent background instead of white or vice versa.
BufferedImage tmpImg = new BufferedImage(image.getWidth(), image.getHeight(),
        BufferedImage.TYPE_4BYTE_ABGR);
for (int w = 0; w < image.getWidth(); w++) {
    for (int h = 0; h < image.getHeight(); h++) {
        if (image.getRGB(w, h) == Color.WHITE.getRGB() && transparent) {
            tmpImg.setRGB(w, h, 0);
        } else if (image.getRGB(w, h) == 0 && !transparent) {
            tmpImg.setRGB(w, h, Color.WHITE.getRGB());
...
BufferedImagetransparentColor(BufferedImage src, Color trColor)
transparent Color
int w = src.getWidth();
int h = src.getHeight();
BufferedImage dst = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
if (src.getRaster().getNumBands() < 3) {
    for (int i = 0; i < 3; i++) {
        dst.getRaster().setSamples(0, 0, w, h, i, src.getRaster().getSamples(0, 0, w, h, 0, (int[]) null));
} else if (src.getRaster().getNumBands() >= 3) {
...