Updated

Have you ever thrown out old chocolate that had taken on a chalky, white hue, unsure if it was still edible? You're not the only one. Food scientists say the harmless change, known as fat blooming, is a major source of complaints and rejections from chocolate lovers and actually costs the confectionary industry millions, according to a study.

The process, which involves fat migrating to chocolate's surface, was also largely a mystery until German scientists decided to take a closer look. They mixed up cocoa, milk powder, cocoa butter, and sugar, ground the mixture to a fine powder, then watched through an X-ray generating synchrotron as sunflower oil was added, Science reports.

Within hours, the oil had melted the chocolate crystals, which allowed the fat in cocoa butter to navigate to the surface where it crystallized, turning the usually glossy treat into an unappealing mess.

"The technology used to examine the samples shows us both the fat crystals and the pores inside the product, down to a scale of a few nanometers," explains a researcher, who worked alongside scientists from Nestle.

"For the first time, we have been able to track in detail the dynamic mechanisms that lead to the creation of fat bloom," another adds. Such a close-up view also revealed clues about how chocolatiers could avoid fat blooming in the future.

"One consequence might, for example, be to reduce the porosity of the chocolate during manufacture, so that the fat migrates more slowly," the study author says, per UPI.

"Another approach is to limit the amount of fat that is present in a liquid form by storing the product in cool, but not too cold, conditions." If you're really serious about keeping your chocolate looking and tasting its best, store it at an optimal 64 degrees, researchers say.

(Scientists are also working on how to make chocolate healthier.)

This article originally appeared on Newser: X-Ray Solves Mystery of Chalky Chocolate

More From Newser