Here you can find the source of xysizeIsWhite(BufferedImage img, int x, int y)
public static boolean xysizeIsWhite(BufferedImage img, int x, int y)
//package com.java2s; import java.awt.Color; import java.awt.image.BufferedImage; public class Main { public static boolean xysizeIsWhite(BufferedImage img, int x, int y) { try {//from ww w .ja va2s. com int tab = 10; for (int i = x; i < x + tab; i++) { for (int j = y; j < y + tab; j++) { int col = img.getRGB(i, j); Color color = new Color(col); if (color.getRed() + color.getGreen() + color.getBlue() < 500) { return false; } } } return true; } catch (Exception e) { return false; } } }