A simple camera hack could help save the rare black leopards of the Malay Peninsula.

Unlike most leopards, which are famously spotty, the Malay leopards are melanistic: they have an all-black coat.

As a result it has been near-impossible for scientists to tell which individual is which. That meant it was impossible to estimate how many there were, hindering research and conservation efforts.

Now scientists from James Cook University in Australia have created a handy little workaround. They adapted the infrared flash of an automatic camera trap to go off even in bright daylight.

These hacked cameras produced a series of photographs that clearly show the unique spots within each leopard's fur.

With the leopards' spots revealed, the researchers were able to accurately identify 94% of the animals in the photos. They hope to extend the technology to other parts of the Peninsula.

The results are published in The Journal of Wildlife Management.