Programs like his may someday be used by law enforcement, said Marcus K. Rogers, head of the graduate Cyber Forensics Program at Purdue University in West Lafayette, Ind. “We do a lot of operational support for law enforcement in our lab here,” said Dr. Rogers, who often searches for images that have been scattered in pieces throughout the hard drive. “Quite often that’s just where the smoking guns are found.”

Dr. Rogers said that sophisticated data-carving programs are unnecessary in simple cases of digital photo restoration, when all the data that represent the photograph are stored in one chunk.

‘Then standard forensic software can generally recover it,” he said.

But if the data are scattered, the problem is much trickier. “This program is a big step forward,” he said. “Before this, it was a fairly manual process of going through the entire drive, looking through for picture fragments and trying to piece them together.” Such a painstaking process could take days.

Even with the best tools, it was usually not possible to restore a photograph completely once the file was fragmented, said Yalkin Demirkaya, president of Cyber Diligence Inc. in Syosset, N.Y. Mr. Demirkaya is the former commanding officer of the computer crimes investigation unit of the Internal Affairs Bureau of the New York Police Department. “Typically,” he said, “we can carve out part of the photographic image, so that we see a little strip of the image on top, for example, but the remainder is blank.”

A version of Dr. Memon’s program will be incorporated into Forensic Toolkit, a software program for digital investigators from the AccessData Corporation in Lindon, Utah, said Brian Karney, the chief operating officer.

Dr. Memon and two of his students, Pasha Pal and Kulesh Shanmugasundaram, have founded Digital Assembly, which sells a consumer version of the software, Adroit Photo Recovery, to restore deleted images ($39.99 at digital-assembly.com). The software cannot recover partial images, where parts of the original image have been overwritten by new data. “But it will recover photos if all of the parts are still present on the storage medium, however scattered,” Dr. Memon said.