Thin film optical elements exhibiting translational invariance, and thus robustness to optical misalignment, are crucial for rapid development of compact and integrated optical devices. In this letter, we experimentally demonstrate a beam-shaping element that generates an annular beam by spatially filtering the fundamental Gaussian mode of a laser beam. The element comprises of a one-dimensional photonic crystal cavity fabricated using sputtered thin films. The planar architecture and in-plane symmetry of the element render our beam-shaping technique translationally invariant. The generated annular beam is sensitive to the polarization direction and the wavelength of the incident laser beam. Using this property of the annular beam, we show simultaneous generation of concentric annular beams of different wavelengths. Our experimental observations show an excellent agreement with simulation results performed using finite-difference time-domain method. Such a beam-shaping element has applications in areas ranging from microscopy and medicine to semiconductor lithography and manufacturing in microelectronics industry.