High-resolution optical techniques for imaging magnetic domains in ferromagnetic materials such as confocal microscopy and scanning near-field optical microscopy (SNOM) are reviewed. The imaging capabilities of different techniques and image formation are discussed in the case of in-plane as well. as out-of-plane magnetic anisotropy in different illumination configurations. It is shown that the magnetooptical resolution of near-field measurements depends on the film thickness and is limited by the diffraction on magnetic domains throughout the film. For thin magnetic films, subwavelength resolution can be attained. In addition to well-known near-field magnetooptical effects (out-of plane magnetization sensitivity of linear near-field microscopy and in-plane magnetization sensitivity of nonlinear near-field measurements), linear SNOM imaging of in-plane magnetization in thin magnetic films as well as nonlinear imaging of out-of-plane domains has been demonstrated. Thus, linear and second-harmonic near-field imaging of both in-plane and out-of-plane oriented magnetic domains can be achieved in transparent and opaque specimens. This enables applications of SNOM for studies of all kinds of magnetic materials. High-resolution optical imaging is required for characterization of the micro-magnetic and magnetooptical properties of novel magnetic structures in order to adopt a bottom-up approach in the search for new materials with improved characteristics.