When Grazia covered the Royal Wedding in May, the magazine took a photograph of the happy couple and altered it, first to remove Prince William, and then to make Kate Middleton more symmetrical – and, as it happens, thinner – by flipping the image of her left side onto her right.

Advertisers and the publishers of glossy magazines retouch pictures all the time. The art of creating fantasy is central to their business. The practice goes on despite concerns that it might harm people's health by promoting unrealisitic expectations of body image.

When the UK considered legislation to label manipulated photos, the industry fought back, and some of its points were valid. Photos are altered for justifiable reasons – to improve colour balance, sharpen contrast and remove marks resulting from dirty lenses, for example. A simple label would be too blunt an instrument.

There is a better way. Computer image specialists Hany Farid and Eric Kee at Dartmouth College in New Hampshire, US, have come up with a technique that measures how much a digital picture has been manipulated. It ignores trivial tweaks that improve the picture quality and focuses on changes that most alter a person's appearance.

The list of changes that are commonly made to photos in magazines and adverts is long. Picture editors airbrush out the darkness under people's eyes, the crow's feet, the wrinkles on the forehead, sagging skin on the neck, freckles, blemishes, and unsightly hairs. They remove folds of skin and body fat, elongate the neck and enlarge the eyes, or even move them slightly.

"Retouching is becoming more extreme," says Farid. "They are no longer making perfect skin, they are making impossible human beings. They are moving us, slowly and surely, in the direction of an over-idealised notion of beauty."

"If you are exposed to these images all the time your notion of a baseline is gone," Farid adds. "They move the line of reality. What is real becomes the published reality."

Farid and Kee wrote software that takes "before" and "after" images and works out how much the original has been changed, whether it's an obvious trimming of the waist, for example, or a subtle softening of wrinkles. To calibrate the system, the scientists asked hundreds of people online to judge before and after images on a scale of one to five, with one being a negligible difference and five being almost unrecognisable.

Writing in the latest issue of the Proceedings of the National Academy of Sciences, Farid and Kee describe how the system can produce a simple and objective rating of retouched images that could flag the worst offenders to readers and help publishers and advertisers rein in excessive digital manipulation.

Adding a number from one to five to a doctored image is unlikely to diminish its impact on a reader, but the ratings might be useful alongside other attempts to make the industry more responsible in its use of retouching.

"This should work both ways," Farid told the Guardian. "It can inform the public and deal with issues in advertising, but also inform publishers. Retouching may get out of hand without them knowing. It might incentivise them not to score a five with all their images on this scale."