In previous work, Liu and Zakhor developed an algorithm for automated design of diffraction compensated phase-shift masks (PSM) in isolated small areas. In our current work we focus on devising an algorithm that performs optimization for larger mask areas up to 100 X 100 micrometers 2. We model Manhattan geometry masks using polygons composed of floating objects -- deformable edge segments and corner serifs. The model accommodates binary masks, alternating phase shift masks, and attenuated phase shift masks. With this underlying model, the positions of mask objects are optimized. Because of the simulation intensive nature of the optimization, we need an efficient intensity calculation method. To this end we employ mask function windowing approximation. We also use the fast Fourier transform (FFT) in changing to and from Fourier representations as necessary in the Hopkin's image intensity equations. We demonstrate the effectiveness of our algorithm in improving image intensity characteristics at the focus plane and at defocus for various examples of binary and phase-shift masks.