Coral itself is not colorful. It gets it's hues from a special types of algae, called zooxanthellae, that lives in its tissues, feeding on the coral’s metabolic waste. In return, the algae produces sugars and amino acids that the coral polyp eats as food.

When coral gets stressed from events like a rise in water temperatures, it ejects its colorful algal companions, turning white in a process called bleaching. But how this happens is not well understood. So to figure it out, a team of researchers from Queensland University of Technology caught this process in action using time-lapse video.

The researchers studied a species of solitary coral, Heliofungia actiniformis, which is considered fairly resilient under harsh conditions. They placed the coral in a 10-liter aquarium, then heated the water from 78 to 89 degrees Fahrenheit over a 12-hour period to mimic warming seas. And let their cameras roll to record the entire bleaching process.

The resulting time lapse video revealed for the first time just how the coral gets rid of the algae. Using “pulse inflation,” the coral swells to 340 percent its normal size, then violently contracts, forcing the algae out of the corals' oral openings.

“What’s really interesting is just how quickly and violently the coral forcefully evicted its resident symbionts [algae],” one of the researchers Brett Lewis says in a press release, “The H. actiniformis began ejecting the symbionts within the first two hours of us raising the water temperature of the system.”

“It’s like you and me coughing or sneezing when we get a cold,” Lewis tells Pallavi Singhal at The Sydney Morning Herald. “It’s a symptom of something else, we’re trying to mitigate or remove what's causing it.”

Lewis explains that as the water increases in temperature, the algae, which produces about 95 percent of the coral's food supply, stops photosynthesizing correctly. They oxidize and become toxic for the coral, which is why the polyps eject them. The researchers suspect H. actiniformis rejects the zooxanthellae more quickly than other species of coral, and may explain why it tends to survive better when sea temperatures increase.

Learning more about bleaching is important as Australia and other nations struggle to protect their reefs. Earlier this year, a massive bleaching event impacted 55 percent of reefs in the northern section of the Great Barrier Reef. A global bleaching event that began last year has impacted reefs in Hawaii, the Indian Ocean and the Caribbean.