Vivid videos have captured stunning shallow-water octopuses performing impressive feats of disguise—changing color and texture to match kelp, coral or the sandy bottom. But what need would a deep-sea octopod, who lives suspended in dim light and darkness, have for fancy disguises?

Plenty, according to a new study published online Thursday in Current Biology. Octopuses living between 400 and 800 meters are faced with subtly changing light conditions that can mean the difference between life and death. In that zone, known as the mesopelagic, sunlight reaches some areas but not others, which means that best camouflage strategies for each needs to be strikingly different. Animals that live where a little light still filters down are better off taking a translucent approach, so that predators aren't as likely to notice their silhouettes. But travel down farther, and the primary source of light is bioluminescence emitted by other animals, for which a black or deep red coloration is more ideal for reflecting these wavelengths of light.

The trouble for many octopus and squid living in that watery dim is that they can move hundreds of meters vertically, and "the boundary between environments where one or the other strategy would be most useful is nether sharp nor fixed, changing with factors such as time of day, cloud cover and turbidity," write the study authors, Sarah Zylinski and Sonke Johnsen, biologists at Duke University.

One tiny species of octopus living in this ever-changing environment, Japetella heathi, can apparently switch its appearance from translucent to pigmented at the drop of a hat—or, to be more precise, the flash of a light beam. The researchers saw that with ambient dim light the 80-millimeter-long octopods were placidly translucent. But when a menacing, bioluminescent-like blue light was pointed toward them, they rapidly became opaque (by expanding pigment-giving cells known as chromatophores). As a last-ditch effort when the light didn't vanish, perhaps sensing that their color-changing had failed to elude the presumed predator, the little octopuses tried an "evasive response," pulling their head into their body. When faced with a red light or a passing overhead object (to mimic a potential predator swimming overhead), the little octopods were not phased and remained translucent. That suggests that this color changing "is not a generalized response to visual threat," but rather a rather specific adaptation to certain predators and light conditions.

Zylinski and Johnsen found that a species of squid that lives in the same zone (Onychoteuthis banskii) was also able to quickly switch from clear to colored in a no time at all. The similarity is a striking example of convergent evolution: "In this vast three-dimensional wilderness…where sunlight is low or nonexistent, food is scarce, and mates are hard to find," they noted, "we see shared solutions in the face of shared problems."