src/data/ImageNoWhite.java
public java.awt.Image convertAWT(java.awt.Image image) {
        BufferedImage original = (BufferedImage) image;
        BufferedImage whiteFilter = new BufferedImage(original.getWidth(),
                original.getHeight(), BufferedImage.TYPE_INT_ARGB);

        Graphics2D g = whiteFilter.createGraphics();
        for (int i = 0; i < whiteFilter.getWidth(); i++) {
            for (int j = 0; j < whiteFilter.getHeight(); j++) {
                if (original.getRGB(i, j) != Color.WHITE.getRGB()) {
                    whiteFilter.setRGB(i, j, original.getRGB(i, j));
                }
            }
        }
        g.dispose();

        return whiteFilter;
    }
/**
     * Takes in an awt image and creates a new one with no white pixels and returns it
     *
     * @param image to be converted
     * @return new image with no white pixels
     */
Takes in an awt image and creates a new one with no white pixels and returns it
@param image to be converted
@return new image with no white pixels
Takes in an awt image and creates a new one with no white pixels and returns it @param image to be converted @return new image with no white pixels
public java.awt.Image convertAWT(java.awt.Image image) {
        BufferedImage original = (BufferedImage) image;
        BufferedImage whiteFilter = new BufferedImage(original.getWidth(),
                original.getHeight(), BufferedImage.TYPE_INT_ARGB);
        Graphics2D g = whiteFilter.createGraphics();
        for (int i = 0; i < whiteFilter.getWidth(); i++) {
            for (int j = 0; j < whiteFilter.getHeight(); j++) {
                if (original.getRGB(i, j) != Color.WHITE.getRGB()) {
                    whiteFilter.setRGB(i, j, original.getRGB(i, j));
                }
            }
        }
        g.dispose();
        return whiteFilter;
    }
public java . awt . Image convertAWT ( java . awt . Image image ) { BufferedImage original = ( BufferedImage ) image ; BufferedImage whiteFilter = new BufferedImage ( original . getWidth ( ) , original . getHeight ( ) , BufferedImage . TYPE_INT_ARGB ) ; Graphics2D g = whiteFilter . createGraphics ( ) ; for ( int i = 0 ; i < whiteFilter . getWidth ( ) ; i ++ ) { for ( int j = 0 ; j < whiteFilter . getHeight ( ) ; j ++ ) { if ( original . getRGB ( i , j ) != Color . WHITE . getRGB ( ) ) { whiteFilter . setRGB ( i , j , original . getRGB ( i , j ) ) ; } } } g . dispose ( ) ; return whiteFilter ; }
Takes in an awt image and creates a new one with no white pixels and returns it
 @param image to be converted
 @return new image with no white pixels
Takes in an awt image and creates a new one with no white pixels and returns it @param image to be converted @return new image with no white pixels