private static Image buildDirectionsImage(Image image, Image Gx, Image Gy) {
		Image direction = image.shallowClone();
		for (int x = 0; x < image.getWidth(); x++) {
			for (int y = 0; y < image.getHeight(); y++) {
				for (ChannelType c : Image.rgbValues()) {
					double pxGx = Gx.getPixel(x, y, c);
					double pxGy = Gy.getPixel(x, y, c);
					double anAngle = 0;
					if (pxGy != 0) {
						anAngle = Math.atan(pxGx / pxGy);
					}
					anAngle *= (180 / Math.PI);
					direction.setPixel(x, y, c, anAngle);
				}
			}
		}
		return direction;
	}