An algorithm for reconstructing the imaginary part of permittivity of an inhomogeneous planar optical waveguide is proposed. The algorithm uses information on the spectrum of imaginary parts of the propagation constants of guided modes. Examples illustrating the efficiency of this approach are provided.