private int getAverage(int x, int y, int size) {
		int[] color = new int[3];
		int count = 0;
		for(int yy = 0; yy < size; yy++) {
			for(int xx = 0; xx < size; xx++) {
				int[] colors = getColorData(x + xx, y + yy);
				color[0] += colors[0];
				color[1] += colors[1];
				color[2] += colors[2];
				count++;
			}
		}
		return (color[2] / count) | (color[1] / count) << 8 | (color[0] / count) << 16;
	}