Diffractive elements that modulate both the amplitude and the phase of an optical field are designed with use of an iterative Fourier-transform algorithm with gradual amplitude clipping at the plane of the element. Unlike phase-only diffractive elements, these complex-amplitude modulating elements do not generate noise outside the signal window W, and their diffraction efficiencies are comparable to the efficiencies of phase-only elements with a noiseless frame around W. Encoding techniques of the complex amplitude into variations of the diffraction efficiency and phase of the zeroth order of a carrier grating are introduced: the shape and the depth of a substructure within each rectangular pixel are modulated. Approximate and rigorous diffraction calculations are performed to compare different substructuring schemes, which all deflect the noise far away from W but differ, for example, in the manner in which this noise is distributed in the signal plane.