mozjpeg icon indicating copy to clipboard operation
mozjpeg copied to clipboard

Need help for jpeg

Open DRCRecoveryData opened this issue 4 years ago • 8 comments

Hi, I repaired some jpeg encrypted jpeg by ransomware ( encrypted 150kb of header ) but when i move the good header to corrupt jpeg, how can i fix the color of this jpeg: DSC_0019

DRCRecoveryData avatar Sep 20 '21 13:09 DRCRecoveryData

I don't think it's a matter of a header. You may be missing a half of a line at the start of the file. Specifically, initial value of DC of luma channel is too high.

kornelski avatar Sep 20 '21 14:09 kornelski

I don't think it's a matter of a header. You may be missing a half of a line at the start of the file. Specifically, initial value of DC of luma channel is too high.

Do you have any idea to fix these image issue? i'm making the batch header jpeg repair tool but don't know how to fix the DCT, yeah is missing some bytes after SOS so image corrupt the color

DRCRecoveryData avatar Sep 20 '21 14:09 DRCRecoveryData

I don't think there's automated way to do it. It's a case of missing data, so it won't be easy to automate.

You will need to inject compressed data that starts the missing line correctly (adds darker blocks first).

kornelski avatar Sep 20 '21 14:09 kornelski

I don't think there's automated way to do it. It's a case of missing data, so it won't be easy to automate.

You will need to inject compressed data that starts the missing line correctly (adds darker blocks first).

Does libjpeg have command to fix the color jpeg?

DRCRecoveryData avatar Sep 20 '21 14:09 DRCRecoveryData

Nothing has. This is not a broken color. The image you have really does look like that. It looks like that, because the data about its real brightness has been lost.

It may be technically possible to figure out how much data is missing by looking at premature end of data (last line is cut off in half), and then guess what the original brightness was by looking at raw decoded unclipped luma data and trying to normalize it. However, this is way beyond scope of libjpeg or any existing decoder. It would require a dedicated JPEG data repair software. I don't know if such software exists.

kornelski avatar Sep 20 '21 16:09 kornelski

[Image.jpeg] Here is the picture i use change DC base from jpegfix 1.1.35 tool Get Outlook for iOShttps://aka.ms/o0ukef


From: Kornel @.> Sent: Monday, September 20, 2021 11:14:08 PM To: mozilla/mozjpeg @.> Cc: Nguyen Vu Ha @.>; Author @.> Subject: Re: [mozilla/mozjpeg] Need help for jpeg (#409)

Nothing has. This is not a broken color. The image you have really does look like that. It looks like that, because the data about its real brightness has been lost.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/mozilla/mozjpeg/issues/409#issuecomment-923072360, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AUKDPPBZQ5XJZ2MOXH3UX4TUC5MVBANCNFSM5EMAMG2A.

DRCRecoveryData avatar Sep 20 '21 16:09 DRCRecoveryData

❓ Maybe you should play with the dct coefficients? For example, as in https://github.com/ImageProcessing-ElectronicPublications/jpegquant ?

zvezdochiot avatar Sep 20 '21 16:09 zvezdochiot

@cuuhodrc say:

how can i fix the color of this jpeg

:information_source: Use https://github.com/ImageProcessing-ElectronicPublications/jpegrepair .

See also https://github.com/dmahurin/jpegrepair/issues/6

zvezdochiot avatar Dec 25 '22 23:12 zvezdochiot