@SuppressWarnings("boxing")
	static Double[][] makeChannelArray(BufferedImage image, Channel channel)
	{
		int width = image.getWidth();
		int height = image.getHeight();

		Double colors[][] = new Double[width][height];		

		switch(channel)
		{
		case RED:
			for (int i = 0; i < width; i++)
			{
				for(int j = 0; j < height; j++)
				{
					colors[i][j] = (double) ColorUtil.red(image.getRGB(i, j));
				}
			}
			break;
		case GREEN:
			for (int i = 0; i < width; i++)
			{
				for(int j = 0; j < height; j++)
				{
					colors[i][j] = (double) ColorUtil.green(image.getRGB(i, j));
				}
			}
			break;
		case BLUE:
			for (int i = 0; i < width; i++)
			{
				for(int j = 0; j < height; j++)
				{
					colors[i][j] = (double) ColorUtil.blue(image.getRGB(i, j));
				}
			}
			break;
		}

		return colors;		
	}