Whether it's a dull sandy seabed or a multi-coloured coral reef, octopuses change the colour of their skin to blend in perfectly with their environment. It now seems their skin is not just obeying instructions from the octopus's brain: it also has local sensors that can perceive light and trigger a colour change.

Soft-bodied cephalopods like octopuses, squid and cuttlefish rely on camouflage to escape from predators. In the highly colourful undersea world, this means constantly changing their skin to match the environment.

Their eyes perceive the surroundings, then the brain processes the information and sends signals directly to the skin, causing dramatic changes of colour and pattern in a matter of milliseconds.

But it's not just the brain that controls the skin patterning, according to two studies in the Journal of Experimental Biology.

Desmond Ramirez and Todd Oakley of the University of California Santa Barbara cut out bits of skin from California two-spot octopuses and kept them in their lab. They found that even though the piece of skin was not "alive" and connected to an octopus, it could still respond to light.

Octopus skin is covered with specialised pigmented organs called chromatophores, which are basically tiny bags filled with coloured chemicals. If the muscles around the chromatophore contract, the bag gets stretched out, revealing the colour.

When Ramirez exposed the biopsied skin to white light, the chromatophores expanded significantly: five-fold in adult skins and two-fold in hatchling skins.

The response was slower than in whole octopuses. Once they were exposed to white light, adult chromatophores took about 6s to start responding, and another 5s to expand fully. "In whole animals, the changes in the chromatophores happen much more quickly," says Ramirez.

Animals have specialised proteins called opsins that respond to light. He and Oakley found that the genes coding for opsins were activated in the octopus skin.

It was the same type of opsin found in the octopus eye, contained in sensory neurons that were packed into the entire surface of each octopus's mantle, head and arms.

The same seems to be true of other cephalopods, according to a second study in the same journal by Thomas Cronin of the University of Maryland Baltimore County and his colleagues.

Working with two cuttlefish and a squid, the group was able to show that all the proteins involved in light detection in the cephalopods' eyes were also found in the skin — specifically, inside their chromatophores.

The findings suggest that cephalopods have two ways of controlling their skin colour. One is central, driven by the brain, and the other is spread throughout their skin.

"What we do not yet know is how these two inputs come together to control chromatophores in the whole animal," says Ramirez.