Maximizing Young’s fringe visibility through reversible optical transformations