Microbial opsins with a bound chromophore function as photosensitive ion transporters and have been employed in optogenetics for the optical control of neuronal activity. Molecular engineering has been utilized to create colour variants for the functional augmentation of optogenetics tools, but was limited by the complexity of the protein-chromophore interactions. Here we report the development of blue-shifted colour variants by rational design at atomic resolution, achieved through accurate hybrid molecular simulations, electrophysiology and X-ray crystallography. The molecular simulation models and the crystal structure reveal the precisely designed conformational changes of the chromophore induced by combinatory mutations that shrink its π-conjugated system which, together with electrostatic tuning, produce large blue shifts of the absorption spectra by maximally 100 nm, while maintaining photosensitive ion transport activities. The design principle we elaborate is applicable to other microbial opsins, and clarifies the underlying molecular mechanism of the blue-shifted action spectra of microbial opsins recently isolated from natural sources.