The ability to visualize directly a large number of distinct molecular species inside cells is increasingly essential for understanding complex systems and processes. Even though existing methods have successfully been used to explore structure-function relationships in nervous systems, to profile RNA in situ, to reveal the heterogeneity of tumour microenvironments and to study dynamic macromolecular assembly, it remains challenging to image many species with high selectivity and sensitivity under biological conditions. For instance, fluorescence microscopy faces a ‘colour barrier’, owing to the intrinsically broad (about 1,500 inverse centimetres) and featureless nature of fluorescence spectra that limits the number of resolvable colours to two to five (or seven to nine if using complicated instrumentation and analysis). Spontaneous Raman microscopy probes vibrational transitions with much narrower resonances (peak width of about 10 inverse centimetres) and so does not suffer from this problem, but weak signals make many bio-imaging applications impossible. Although surface-enhanced Raman scattering offers high sensitivity and multiplicity, it cannot be readily used to image specific molecular targets quantitatively inside live cells. Here we use stimulated Raman scattering under electronic pre-resonance conditions to image target molecules inside living cells with very high vibrational selectivity and sensitivity (down to 250 nanomolar with a time constant of 1 millisecond). We create a palette of triple-bond-conjugated near-infrared dyes that each displays a single peak in the cell-silent Raman spectral window; when combined with available fluorescent probes, this palette provides 24 resolvable colours, with the potential for further expansion. Proof-of-principle experiments on neuronal co-cultures and brain tissues reveal cell-type-dependent heterogeneities in DNA and protein metabolism under physiological and pathological conditions, underscoring the potential of this 24-colour (super-multiplex) optical imaging approach for elucidating intricate interactions in complex biological systems.