Tiny droplets of water, colored blue, are suspended in oil on top of a membrane developed by the Massachusetts Institute of Technology team.

Thanks to the membrane’s tiny pores, with a special coating that attracts water and repels oil, the droplets shrink as they pass through the membrane, ultimately leaving just pure oil behind. A similar membrane with a different coating can do the reverse, allowing oil droplets to pass while blocking water.