Flat optics for spatially resolved amplitude and phase modulation usually rely on 2D patterning of layered structures with spatial thickness variation. For example, Fabry–Perot-type multilayer structures have been applied widely as spectral filter arrays. However, it is challenging to efficiently fabricate large-scale multilayer structures with spatially variable thicknesses. Conventional photo/eBeam-lithography-based approaches suffer from either low-efficiency and high-cost iterative processes or limitations on materials for spectral tunability. In this work, an efficient and cost-effective grayscale stencil lithography method is demonstrated to achieve material deposition with spatial thickness variation. The design of stencil shadow masks and deposition strategy offers arbitrarily 2D thickness patterning with low surface roughness. The method is applied to fabricate multispectral reflective filter arrays based on lossy Fabry–Perot-type optical stacks with dielectric layers of variable thickness, which generate a wide color spectrum with high customizability. Grayscale stencil lithography offers a feasible and efficient solution to overcome the thickness-step and material limitations in fabricating spatially thickness-varying structures. The principles of this method can find applications in micro-fabrication for optical sensing, imaging, and computing.