The bacteria-based photonic device is analogous to liquid-crystal-based devices where the liquid crystals and an electric field are replaced by magnetic bacteria and a magnetic field, respectively. The controlled orientation of the bacteria in the device is used to tune the intensity and the polarization of the light.