Hacker News new | ask | show | jobs
by afhof 4660 days ago
Its doubtful that the image can be recovered. The information really is gone. I suspect it would be easier to make it simple to have redundant copies of the data, rather than trying to fix the images after they're gone.
2 comments

If it's only a single bit that's toggled, you can just iterate through all the bits until you find one that fixes the image after you flip it.
For a 1MB JPEG, that'd be over 8 million different images.
If you could point to a region of the image where the corruption begins, you would reduce the number of possible images significantly.
That sounds plausible. Another idea: choose a section of "bad image" and a section of "good image" which should have similar colours and then generate mutations of the corrupted DCT square until you have a close match between the two areas.
Given that we're assuming some kind of correctness metric for the final image, could we not also use this metric to locate the start of the corruption?
For a single byte error that is visibly obvious, you could just iterate through 255 combinations until the user thinks the image looks right.
Yeah maybe you could have the user iterate through a search tree the way an optometrist performs an eye exam, "Which is better, one flip or two?"

But I don't know if there is a way to create a tree of the possibilities.