Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

How to detect and remove transparent pixels in image using java opencv

I tried pixelgrabber to find the transparent pixel but i am not getting the position of the pixel from the image.This is my first question in stack overflow, so plz help me with this

Image image = new ImageIcon(IMAGE_PATH).getImage();
        if (image instanceof BufferedImage) {
            BufferedImage bimage = (BufferedImage) image;
            System.out.println(bimage.getColorModel().hasAlpha());
        }
        PixelGrabber pg = new PixelGrabber(image, 0, 0, 100, 100, true);
        try {
            pg.grabPixels();

        } catch (InterruptedException e) {
        }
        ColorModel cm = pg.getColorModel();
        System.out.println(cm.hasAlpha ());
        }

Comments