Inference of colour patterning in extinct dinosaurs has been based on the relationship between the morphology of melanin-containing organelles (melanosomes) and colour in extant bird feathers. When this relationship evolved relative to the origin of feathers and other novel integumentary structures, such as hair and filamentous body covering in extinct archosaurs, has not been evaluated. Here we sample melanosomes from the integument of 181 extant amniote taxa and 13 lizard, turtle, dinosaur and pterosaur fossils from the Upper-Jurassic and Lower-Cretaceous of China. We find that in the lineage leading to birds, the observed increase in the diversity of melanosome morphologies appears abruptly, near the origin of pinnate feathers in maniraptoran dinosaurs. Similarly, mammals show an increased diversity of melanosome form compared to all ectothermic amniotes. In these two clades, mammals and maniraptoran dinosaurs including birds, melanosome form and colour are linked and colour reconstruction may be possible. By contrast, melanosomes in lizard, turtle and crocodilian skin, as well as the archosaurian filamentous body coverings (dinosaur 'protofeathers' and pterosaur 'pycnofibres'), show a limited diversity of form that is uncorrelated with colour in extant taxa. These patterns may be explained by convergent changes in the key melanocortin system of mammals and birds, which is known to affect pleiotropically both melanin-based colouration and energetic processes such as metabolic rate in vertebrates, and may therefore support a significant physiological shift in maniraptoran dinosaurs.