The researchers started by collecting plain-looking termites from the wild. Then they pasted pieces of paper to their backs that more or less looked like capes — either solid black, solid white or striped in black and white.

This was not the latest effort to introduce tiny heroes to the Marvel Cinematic Universe. It was an attempt to learn something about how jumping spiders, some of nature’s most widespread and canny predators, perceive their prey.

In nature, most prey avoid being detected by predators by blending into their surroundings. But some species strive to stand out. Monarch butterflies, yellowjacket wasps and ruby-red velvet ants, for example, use bright or contrasting coloration to warn predators of their toxicity.

Scientists are still trying to decipher which predators perceive such displays. Especially little is known about how jumping spiders process these color patterns. According to Lisa Taylor, a behavioral ecologist at the University of Florida, they possess keen vision thanks to a set of large, forward-facing eyes.

To determine how two species of jumping spiders react to vibrant warning signals, Dr. Taylor and her colleagues outfitted termites in capes fit for scientific cosplay and put them in a petri dish with the eagle-eyed arachnids. Their findings, published on Wednesday in the journal Royal Society Open Science, reveal that while the spiders quickly spotted the termites in the striped capes, they rarely attacked the striped termites, providing an explanation for why myriad other species use striking stripes to scare off predators.

Most prior research on how predators perceive aposematic or conspicuously colorful displays has revolved around carnivorous birds. But the majority of species with such patterns are small insects. This means that they likely evolved their visual defenses in response to arthropod predators, like arachnids.