JPEG File Repair From Missing Sectors

Jared

Administrator
Staff member
I've been working on a solution to effectively repair corrupted jpg files damaged by unread bad sectors, and I think I've finally worked up a solution that's can effectively restore pictures with a few bad sectors to an acceptable condition (the ones that open but the image is shifted, discolored, etc.). It has to be done manually, can't batch repair, but I'm toying with the idea of offering a service to repair images on a per file basis.

I was thinking of charging somewhere around $10/image to repair them, so obviously won't be doing entire folders of hundreds of pictures, just selected ones. Anyone know of customers who might be interested in this service?

If you have a sample picture you'd like to post here I can fix it to demonstrate the results. It's not perfect, but pretty darn good.
 

HaQue

Moderator
interesting, I am sure there would be some customers. I would say create a webpage to explain your service, with some before and after images as proof/description of what is obtainable. Not sure you could find customers until they need you. I would be interested in some before and after pictures to see whats possible. good work!
 

LarrySabo

Member
I have some examples I can provide but I would need my customer's permission for them to be shared. They have streaks of missing data, shifted portions, etc. If you want them to use for testing, not to be shared/posted anywhere, I can provide a few privately.

Photorec was superior to several other photo recovery programs I tried in a test quite some time ago. The author obviously figured something out that the others had not at the time. Here's the summary from the 2010 test:
Had a job to recover pictures from a 4GB flash drive last week and thought the following results comparison might be of interest:

- Recuva undeleted 197 pictures, of which 177 were readable (not "X"ed out)
- GetDataBack FAT recovered 221 usable pictures, plus some partial images
- PhotoRec (free for private and commercial use!) recovered 354 good images!

PhotoRec also recovers other file types and was pretty fast. I'm definitely going to experiment with using it in addition to my other recovery programs in the future. Surprising how it was so successful at recovering pictures that were "broken" or incomplete when recovered using the other programs.
 

Jared

Administrator
Staff member
I have plenty of pictures here I could use for testing purposes, been doing that already. The reason I'm asking for pictures from someone else like this is that it proves my technique actually repaired the damaged file, and I didn't already have the original to use. Even if it's just a picture of some scenery without any personally identifiable faces in it, or a file you mess up intentionally by deleting a couple sectors.
 

Jared

Administrator
Staff member
OK, I've made a quick sample to show what I can do in this JPEG repair process. This is using a picture I actually took and damaged on purpose for this comparison.

First I deleted about a dozen sectors at 3 locations in the jpg, resulting in this:
100_4068.JPG

Then I removed the damaged jpeg stream blocks, fixed the color stream, and adjusted the remaining blocks until they all align properly. This resulted in this, which as you can see still has gray areas from the missing blocks of data:
100_4068_fixed.jpg

Finally I fill in the missing blocks with approximated data from the surrounding area resulting in this fully repaired image:
Comparison.jpg


Now if you take and compare the original image (before I damaged it) to the fixed one, you can see there are some anomalies which appear like a little smudge in the image if you zoom in close. This image shows the difference:
100_4068_fixed2.jpg

Certainly isn't a perfect fix, but unless the damaged block is right in the middle of someone's face it's unlikely you'll even notice the repair from the original.
 

Jared

Administrator
Staff member
Now here's a demonstration using deleted 4K sector size. Obviously it causes more damage with the larger sector size. In this case I deleted only two sectors.

Damaged File:
100_4589.jpg

Damaged Blocks Removed and Color Fixed:
100_4589_fixed.jpg

Missing Areas Filled In:
100_4589_fixed2.jpg

And the Original Undamaged File for Comparison:
100_4589_Original.JPG
 

Jared

Administrator
Staff member
Now if anyone else would like a further demonstration, please post a damaged file for me to fix.

[glow=Green]One free demo for anyone![/glow]

If all you have are customer files, you can PM me one, I'll fix it and PM back to you so it isn't publically posted.
 

LarrySabo

Member
Wow, that's impressive, Jared! Let me know when you've automated the process and are offering it as a commercially available program (heavily discounted for current forum members, of course). :) Seriously, you could make some serious money with such a program.
 

Jared

Administrator
Staff member
LarrySabo":6khy0t07 said:
Wow, that's impressive, Jared! Let me know when you've automated the process and are offering it as a commercially available program (heavily discounted for current forum members, of course). :) Seriously, you could make some serious money with such a program.

It requires a few techniques and a fair amount of manual tweaking each time. I don't think an automatic anything is likely to ever happen. At least I know I don't have the programming skills to do it. It requires being able to see what's happening to the image as you're doing it, and I don't think any automated software could quite replicate the results. That's why I'm thinking it'll have to be a service rather than an app.

Perhaps not everyone would be interested in the service but, if it's some good wedding pictures that were lost some selected ones might be worth the $10/ea cost to get them fixed.

Anyway, it's a service that now exists you can mention to your customers if they're interested. Heck, for you guys who are looking to re-sell the service I'll do it at $7/ea so you can mark it up to $10 and make a little extra for yourselves.
 
Top