Spending a lot of time on image-processing programmes before uploading the photos on your cellphone to social media sites may soon become a thing of the past as researchers have created a new system that can automatically retouch images in the style of a professional photographer.

It is so energy-efficient that it can run on a cellphone, and it is so fast that it can display retouched images in real-time, so that the photographer can see the final version of the image while still framing the shot, according to a paper presented at Siggraph 2017, a digital graphics conference here. 

The same system can also speed up existing image-processing algorithms.

In tests involving a new Google algorithm for producing high-dynamic-range images, which capture subtleties of colour lost in standard digital images, the new system produced results that were visually indistinguishable from those of the algorithm in about one-tenth the time — again, fast enough for real-time display.

The system is a machine-learning system, meaning that it learns to perform tasks by analysing training data.

In this case, for each new task it learned, it was trained on thousands of pairs of images, raw and retouched.

The work builds on an earlier project by MIT researchers, in which a cellphone would send a low-resolution version of an image to a web server. 

The server would send back a "transform recipe" that could be used to retouch the high-resolution version of the image on the phone, reducing bandwidth consumption.

"Google heard about the work I'd done on the transform recipe," said Michael Gharbi, an MIT graduate student in electrical engineering and computer science.

"They themselves did a follow-up on that, so we met and merged the two approaches. The idea was to do everything we were doing before but, instead of having to process everything on the Cloud, to learn it. And the first goal of learning it was to speed it up," Gharbi, said. 

"This technology has the potential to be very useful for real-time image enhancement on mobile platforms," said Jon Barron of Google. 

"Using machine learning for computational photography is an exciting prospect but is limited by the severe computational and power constraints of mobile phones.

"This paper may provide us with a way to sidestep these issues and produce new, compelling, real-time photographic experiences without draining your battery or giving you a laggy viewfinder experience," Barron added.