Radiation power absorbed by a half-infinite sample irradiated by microwave field incident normally to the sample surface is calculated. Local properties of the sample, such as electric conductivity, magnetic susceptibility, concentration of localized spins, etc., are supposed to be nonhomogeneous in the direction perpendicular to the surface. In linear on magnetic susceptibility approximation, algorithms of electron paramagnetic resonance imaging are suggested for the case of conducting and lossy-dielectric materials. These algorithms are tested by numerical simulations. Obtained results can be applied to nuclear magnetic resonance imaging as well.