How was the edit revealed?

The edited image was discovered by Mr Allen’s lawyer last month, who argued that it was done by police in order to make his client more closely resemble the suspect.

“This is a very, very slippery slope given the advent of technology,” argued lawyer Mark Ahlemeyer. “We don’t know where this may end.”

Prosecutors contended the suspect’s “immutable facial features” resembled Mr Allen’s closely enough for him to be included in the photo line-up with five other men.

Assistant US Attorney Paul Maloney argued that Mr Allen could have applied cosmetics prior to the crime spree, and told the court that investigators “applied the digital equivalent of makeup” to the picture.

Media playback is unsupported on your device

Media captionHow police line-ups jail the innocent

“The whole idea was to make Mr Allen blend in so his photo wouldn’t stand out,” he said. “These procedures were prudent. They were appropriate.”

In a hearing on Wednesday, Portland Police Detective Brett Hawkinson testified the point of altering the photo was to “mask things that would stand out” to witnesses.

Forensic criminologist Mark Weber, who testified that he “basically painted over the tattoos… almost like applying digital make up”, acknowledged that he had done the same thing for other line-ups and had not documented the edit.

In response Mr Ahlemyer asked: “If a witness reports that a perpetrator did not have any front teeth, can the government simply black out a suspect’s teeth on the theory that it could be done with cosmetics?

“Or if a suspect’s skin colour is too dark or too light as compared to objective video evidence, can the government simply press a few strokes on a computer keyboard and adjust the colour to match that objective evidence?”

US District Judge Marco A Hernandez has said he will soon issue a ruling on the admissibility of the photo.

Photo line-ups have long been called problematic by critics who argue that they can be unnecessarily suggestive to witnesses.

A federal guideline announced only months before Allen’s arrest in January 2017, say any alterations to photos must be documented, as well as the reason for doing so.