That's what vision is.

There are different kinds of chromophores, and they’re usually based on the same chemical backbone—vitamin A—with a few subtle tweaks. These tweaks can make a huge difference. They alter the wavelength of light that the chromophores absorb best, and so change the colors that the visual pigments are most sensitive to.

In 1896, scientists first noticed that the visual pigments of freshwater fish are shifted towards the red end of the spectrum compared to their seafaring peers. In the 1930s, the American scientist George Wald showed that this difference depends entirely on the chromophore: Marine fish have vitamin A1 while freshwater fish have vitamin A2. (Wald was the person who discovered vitamin A’s role in vision, which earned him a Nobel Prize in 1967.)

In the 1950s and 60s, Wald and others showed the choice of chromophore isn’t set in stone. Fish like salmon and lampreys, which straddle the realms of salt and fresh water, can switch between A1 to A2 when they swim upstream, enhancing their ability to see infrared in waters where that ability matters.

Now, Jennifer Enright and Joseph Corbo from Washington University School of Medicine have finally shown how these animals do it.

Enright and Corbo studied zebrafish, whose retinas normally contain vitamin A1, but can be shifted almost entirely to vitamin A2 with hormone treatments. They also looked at the eyes of American bullfrogs. Most amphibians switch from vitamins A2 to A1 when they metamorphose from aquatic tadpoles to land-living adults. But bullfrogs spend a lot of time at the water’s surface, with their eyes partly submerged. So they keep vitamin A2 in their upper retinas, which receive light coming up from the water below, while converting to A1 in lower parts that get light from the air above. They have bifocal night-vision goggles!

In both cases, Enright and Corbo found that the presence of vitamin A2 in the retina precisely coincides with the activity of one particular gene, known as Cyp27c1. They confirmed that the gene makes an enzyme that converts A1 into A2—and they showed that fish with mutated versions of the gene cannot carry out these transformations, and never gain the ability to see infrared.

If the same enzyme is at work in bullfrogs and zebrafish, which are distantly related, Corbo is positive that it acts similarly in salmon and lampreys. “We don't have the direct experimental evidence but we're very certain that's the case,” he says.

“The paper’s like the dénouement in a whodunit,” says Kristian Donner from the University of Helsinki. “The motive—more efficient use of the [red-shifted light] in lakes—has been known for 80 years, but the perpetrator has escaped discovery until now.” Donner says that tracing the evolution of Cyp27c1 in different groups of animals might give us new clues about their lives.