In this work we present experimental evidence of an anamorphic and spatial frequency dependent phase modulation in commercially available twisted nematic liquid crystal spatial light modulators. We have found that the phase modulation depth depends on the magnitude of the local spatial frequency component along the horizontal direction. Along the vertical direction the phase modulation depth does not depend on the spatial frequency. This phenomenon is related with the electronics driving the device and in no way related to liquid crystal physics. It causes a reduction of the optical efficiency of a diffractive optical element displayed onto this type of modulator. We present an algorithm to correct this effect and more efficiently display a diffractive optical element. We apply it to the particular case of a Fresnel lens. Experimental results that confirm the improvements in the efficiency of the displayed diffractive lens are presented. © 2005 Optical Society of America.