Pixelated gradient thickness optical filter for visible light spectroscopy