Here the 4D printing of a magnifying polydimethylsiloxane (PDMS) lens encoded with a tunable plasmonic rejection filter is reported. The lens is formed by moldless printing of PDMS pre-polymer on a nanostructured porous silicon (PSi) templating layer. A nanometer-thick plasmonic filter is integrated on the lens surface by in situ synthesis of Ag and Au nanoparticles (NPs) with programmed density. The filter can be designed to reject light at the plasmonic resonance wavelength of the NPs with an optical density tunable from 0 to 3 and retreive light at longer wavelengths with a pass-to-stop band ratio tunable from 0 to 60 dB. Swelling of PDMS in hexane and ether is used to change the NP density on the lens surface and modulate, in turn, the transmittance properties of the NP-decorated lens over 3 orders of magnitude. The plasmon-encoded lens is coupled to a commercial smartphone demonstrating: shaping of the emission spectrum of a white light-emitting diode to tune the color from yellow to purple; real-time bright-field and fluorescence microscopy of living microbes in water, namely, the auto-fluorescent green alga Chlorogonium sp. and the ciliated protozoan Euplotes daidaleos.