Call it a character flaw or a virtue, but I'm ridiculously frugal. I hate letting things go to waste—food from a meal at a restaurant, the stale water left in a cup overnight, the last few drops of shampoo you can't eke out of the bottle. I've spent days with an upside-down container in my bathroom, waiting for its viscous liquid to slooooowly slide out.

A surprising amount of stuff gets wasted every year because consumers can't get it out of the packaging it came in—as much as 15 percent of every tube of toothpaste, bottle of glue, or container of ketchup is simply tossed out. LiquiGlide, founded by a group of materials scientists at MIT, has a solution: a surface that allows pretty much anything to roll right off, like oil on a frying pan. On Tuesday, the company announced an agreement with the international food packaging company Orkla to use its coating inside mayonnaise bottles—the perfect match for its viral ketchup-pouring video from a few years back.

Ketchup Bottle w/ LiquiGlide Coating from LiquiGlide on Vimeo.

Now, plenty of coatings can make for slippery packaging, but they have one fundamental problem: They're toxic. They're great for things like windshields and boots, but the chemicals used to create so-called superhydrophobic surfaces—which mimic the functionality of a lotus leaf by capturing a cushion of air between a textured solid and a smooth liquid—definitely can't be used with food.

So how does LiquiGlide build a food-safe solution? The company's tech isn't a formulation, but a formula. Rather than making a single superhydrophobic surface suitable for all products, it has created an algorithm to optimize the thermodynamic relationships between a textured solid on the inside of the bottle, its liquid "lubricant," and the product in question. When the solid matches the liquid just right, capillary forces create a permanently wet, highly stable coating that the product inside a bottle flows right over. The technical term for it is "liquid-impregnated surface." And for products like mayo, the company can limit its selections to solids and liquids already recognized as safe for consumption by the FDA.

Finding that balance of solid and liquid isn't easy. "In most cases you could create a liquid-impregnated surface pretty easily—liquids just wick into textured surfaces," says Dave Smith, LiquiGlide's CEO. But introduce another liquid—in this case, a viscous condiment—into the equation and things get tricky. That product can displace the liquid and stick to the solid. That's how you end up with that dollop of glue, ketchup, or lotion you can't get out of the bottle.

With the right interaction between the wicking texture and the liquid seeping into it, LiquiGlide can improve what materials scientists entertainingly call a surface's "wettability." If you put a droplet of a liquid on a surface, it either beads—that's low wettability—or melds into the surface, making it highly wettable. The behavior of that combination also is highly dependent of the product that'll be sitting on top of it. "The coating for mayo won't work for ketchup, which also won't work with a medical device application," says Smith. The liquid needs to "preferentially wet" the product, so it sticks to the solid but lets the product roll right off.

The company can't be too specific about the best combination for its mayonnaise bottle coating, but Smith explains the basic process like this. First, he must narrow his liquid choices: It'll have to be food-safe, and immiscible with the product so it doesn't mix with the mayo or ketchup. The liquid also has to have a fairly high surface energy. "Liquids that are high surface energy bead up more, and low surface energy ones spread out more," says Smith.

Then, "the trick is in choosing the right solid to go with the particular liquid," says Smith. LiquiGlide has a database with hundreds of textured surfaces, described in terms of their micro-scale surface features in a range of shapes, sizes, and depths. The smaller those features—which range from nanometers to microns-wide—the stronger the capillary forces will be to keep the impregnated liquid in place.

The result of each of those thermodynamic optimizations is pretty impressive. Here's what a typical plastic container looks like when you try to squeeze the viscous stuff out, compared to a bottle coated with one of LiquiGlide's solid-liquid pairs:

Mayonnaise w/LiquiGlide from LiquiGlide on Vimeo.

Of course, this technology has applications beyond condiments. Kripa Varanasi, LiquiGlide's coinventor, says liquid-impregnated surfaces could change many industries' approach to waste and efficacy. "It's a shift in thinking, getting a whole range of material properties that were not possible before," he says. Since its founding in 2012, the company has taken on clients seeking more than 30 applications, including consumer packaging. It has a collaboration with Elmer's glue, for example.

But the company also is focusing on bigger problems. Smith and Varanasi developed the algorithm while trying to find a way of preventing methane hydrate buildup in oil and gas pipelines. Now, they're working on de-icing coatings, self-cleaning surfaces, and ways to increase condensation runoff in power plants' steam cycles. In the meantime, we can all be happy to squeeze out that last bit of shampoo.