Octopuses and cuttlefish are the ultimate wallflowers. By changing the patterns and colors of their skin, these cephalopods can slip into the background of almost any seafloor scene.

Squid, in comparison, are usually translucent or iridescent, but that doesn't mean they don't have a colorful trick or two up their eight sleeves.

Recently, scientists in Japan were surprised to find a species of oval squid raised in captivity could change its coat, depending on whether its tank was clean or covered in algae.

Usually, this species, known as the white-squid (Sepioteuthis lessoniana sp.2), is light in color to match the bright ocean surface where it is typically found. Against a dirty layer of glass, however, the cephalopods suddenly grew much darker.

Researchers experimented with the accidental discovery and cleaned one half of the squid's tank while leaving the other half dirty.

The video footage the authors subsequently collected shows remarkable squid camouflage in action. As the species swims from the tank's algae side to the tank's clean side, its skin immediately switches from light to dark.

According to the authors, it's the first time a squid has been caught camouflaging against a background under laboratory conditions.

"This effect really is striking. I am still surprised that nobody has noticed this ability before us," says biologist Zdenek Lajbner from the Okinawa Institute of Science and Technology (OIST) in Japan.

"It shows just how little we know about these wonderful animals."

Compared to the camouflaging abilities of octopus and cuttlefish, squid camouflage has received far less attention.

Most of the time, these creatures hover in the open ocean, which means there's little need for them to change their skin to suit a substrate. Instead, they shimmer or flicker with the sunlight.

Against a coral reef or the seafloor, however, these creatures might be more prompted to match the color of their background.

For instance, in the wild, the Caribbean reef squid (Sepioteuthis sepioidea) has been caught changing its color to suit particular types of coral, even ones with complex, mottled patterns.

Meanwhile, the longfin inshore squid (Doryteuthis pealeii), which lives on the ocean shelf, is known to polarize its skin so that predators can't see it. This squid species can also countershade against a background, which means it can go from a lighter shade to a darker shade or vice versa. That's not quite the same thing as changing color, but it's close.

Even deep-sea squid, like Onychoteuthis banksii, are reportedly capable of switching between transparency and pigmentation to camouflage in darker waters.

"If substrate is important for squid to avoid predation, then that indicates that increases or decreases in squid populations are even more tied to the health of coral reef than we thought," says Ryuta Nakajima, who studies cephalopod behavior at OIST.

The adult white-squid studied in the current paper were raised in captivity after researchers collected the eggs from the wild, and all of them showed flawless substrate color matching in the lab.

Within two seconds or less, the creatures could change their color to fit their scene. What's more, this color change occurred after every border-crossing event, and the changes only ever occurred during these crossings.

Camouflage among squids is often thought to be based on transparency, but these squid are also using pigment cells, called chromatophores, to adjust their color to the background.

It's still not clear how white-squid behave in the wild, but the authors of the study note that the very same year they conducted these experiments, someone uploaded a video to YouTube that showed an oval squid (the same species of squid as the one in the paper but a different subtype) camouflaging on a reef in Tanzania in a similar way.

"White-squid possess a rare combination of semitransparency and the ability to change body color via chromatophores which enables them to successfully inhabit both pelagic and reef environments," the authors conclude.

"Therefore, it represents an attractive model organism for studying the ecology, evolution, and neurobiology of versatile, dynamic camouflage."

The study was published in Scientific Reports.