Optimizing the Output image