@Override
	public BufferedImage Generate(BufferedImage img){
		
		// Make original image greyscale
		
		double[][] greyscale = new double[img.getHeight()][img.getWidth()];
		
		for(int x = 0; x < img.getWidth(); x++){
			for(int y = 0; y < img.getHeight(); y++){
				Color color = new Color(img.getRGB(x, y));
				greyscale[y][x] = (color.getRed() + color.getGreen()+ color.getBlue()) / 3;
			}
		}
		
		// Filter image using operator on both axes
		
	    double[][] X = Convolve(greyscale, OPERATOR_X());
	    double[][] Y = Convolve(greyscale, OPERATOR_Y());
		
		// Initialize the image to return
		
		BufferedImage result = new BufferedImage(img.getWidth(), img.getHeight(), BufferedImage.TYPE_INT_RGB);
	    
		for(int x = 0; x < img.getWidth(); x++){
			for(int y = 0; y < img.getHeight(); y++){
				float red = Math.min(1,(float) X[y][x]);
				float green = Math.min(1,(float) Y[y][x]);
				float blue = Math.min(1,(float) ((X[y][x] + Y[y][x])) * 2);
				Color color = new Color(red, green, blue);
				//Color color = Color.red;
				result.setRGB(x, y, color.getRGB());
			}
		}
		
		return result;
	}