public static int[][] getGreen(BufferedImage in){
		int width = in.getWidth();
		int height = in.getHeight();
		int[][] green = new int[height][width];
		try {
			

			

			int[] data = new int[width * height];
			
			
			in.getRGB(0, 0, width, height, data, 0, width);

			for (int i = 0; i < height; i++) {
				for (int j = 0; j < width; j++) {
					green[i][j] = ((data[i*height + j] >> 16) & 0xff);
				}
			}

			writeToTextFile(green,"green");

		} catch (Exception e) {
			System.err.println("Error: " + e);
		}
		
		return green;
	
	}