With its trademark patches of black and white fur, there's no mistaking the giant panda for any other bear.

Now scientists have a better idea of why pandas have this distinctive pattern, and it could all come down to the lengths the poor old animal has to go to just to get enough to eat.

Colouration in the animal kingdom can perform a whole bunch of tasks, from attracting mates, to warning off predators, to blending into the background.

To figure out why an organism is coloured the way it is, biologists will often compare them with like-patterned species occupying similar niches in other environments.

For example, in spite of living on opposite sides of the globe, leopards (in Africa and Asia) and jaguars (in the Americas) have similar black-on-tan spots covering their body, which helps break up their outlines into sun-dappled environments as they stalk their prey.

The problem is, pandas are rather unique; while contrasting stripes and spots are common across the animal kingdom, an outfit consisting of black stockings, black shirt, eye-spots, and dark ears is pretty rare.

So researchers from the University of California, Davis, and California State University, Long Beach, worked together to pull apart the panda's patterns and match each body part separately with a comparable critter.

"The breakthrough in the study was treating each part of the body as an independent area," explained Tim Caro from UC Davis.

The team compared distinct areas of black and white on the panda with the colourations of 39 bear subspecies, as well as another 195 species of carnivore, paying close attention to their specific habitats.

The researchers perused thousands of images, studying at least 20 possible colours over more than 10 areas of the body.

"Sometimes it takes hundreds of hours of hard work to answer what seems like the simplest of questions: Why is the panda black and white?" said researcher Ted Stankowich.

Viewed this way, it seems the panda is piebald to blend into two different environments within the mountainous regions of central China it calls home, while allowing it to communicate with friends and foes.

Unlike their more carnivorous cousins, pandas rely heavily on a vegetarian diet of bamboo shoots, which although plentiful within their habitat, isn't the easiest meal to digest.

Pandas compensate by limiting their movement, however no matter what their pudgy appearance might tell you, they still don't manage to store away enough fat to see them through the lean months of winter.

That means pandas need to remain active year round, putting up with the freezing fall of snow as they find enough food to satisfy their energy needs.

Having white bellies and a white head helps them blend into an icy background without being harassed by the snow leopards or jackals which might see them as lunch.

Dark socks and sleeves, on the other hand, help them hide in the shadows of tropical bamboo groves they hide in during the warmer months.

Those soulful panda eyes were hypothesised to help the animals communicate with one another, or perhaps serve as a way to signal aggression to a competitor, while their ears could perform similar 'stay away, I'm angry' signalling to predators.

Only a few years ago, the same team of researchers argued a zebra's stripes helped confuse flying insects, offering them some protection against the scourge of biting flies.

Of course, this might not be the final word on panda colours, yet it does open the way for further discussion.

After all, not everything in nature is so black and white.

This research was published in Behavioral Ecology.