Add edge detection and contrast maximization