We show that both a lens and a nonuniform amplitude transmission filter can be encoded simultaneously onto a twisted nematic liquid-crystal spatial light modulator (SLM) working in the phase-only mode. The inherent equivalent apodization that is due to the pixelated structure of the SLM is compensated for. In addition, different types of nonuniform transmission pupil such as transverse apodizing, transverse hyperresolving, and axial hyperresolving (multifocusing) filters are implemented. The excellent agreement between numerical and experimental results shows the capability of this method to encode amplitude apodizers on a phase-only SLM. © 2001 Optical Society of America.