We present here fully optimized two-dimensional pupil apodizations for which no specific geometric constraints are put on the pupil plane apodization, apart from the shape of the aperture itself. Masks for circular and segmented apertures are displayed, with and without central obstruction and spiders. Examples of optimal masks are shown for Subaru, SPICA and JWST. Several high-contrast regions are considered with different sizes, positions, shapes and contrasts. It is interesting to note that all the masks that result from these optimizations tend to have a binary transmission profile.