Nanostructures have attracted great interest in recent years as they display quite different characteristics from their bulk behavior. The applications of nanostructures, including thin films and photonic crystal slabs, are explored in the field of thermal emission, photon management and spectral sensing. Infrared thermal emission from metals has important energy applications in thermophotovoltaics, radiative cooling, and lighting. Unfortunately, the emissivity of flat metal films is close to zero because the screening effect prevents metals' fluctuating currents from emitting to the far field. As a result, metal films are often used as reflecting mirrors instead of thermal emitters. Recently, nanostructured metals, such as metamaterials, have emerged as an interesting way to enhance and to spectrally control thermal emission based on plasmonic resonant effects. However, they require sophisticated lithography. Here, a completely different mechanism to achieve spectrally selective metallic emitters based on a tunneling effect is proposed and experimentally demonstrated. This effect allows a simple flat metal film to achieve a near-unity emissivity with controlled spectral selectivity for efficient heat-to-light energy conversion. Index-near-zero thin films can be used for effective photon management. They help to restrict the angle of acceptance, resulting in greatly enhanced light trapping limit. In addition, these materials also decrease the radiative recombination, leading to enhanced open circuit voltage and energy efficiency in direct bandgap solar cells. A method of spectral sensing based on compressive sensing is shown to have the potential to achieve high resolution in a compact device size. The random bases used in compressive sensing are created by the optical response of a set of different nanophotonic structures, such as photonic crystal slabs. The complex interferences in these nanostructures offer diverse spectral features suitable for compressive sensing.