JPEG Medic // Accurate Manual JPEG Recovery
Table of Contents
  1. Overview
  2. Theory of JPEG Repair
    1. JPEG structure
    2. How to fix broken JPEG file
  3. Working with the Program
    1. Main menu
    2. Virtual folder tree
    3. Files panel
    4. Preview panel
    5. Cluster view
    6. Hex view
  4. Repairing JPEG image
    1. Opening JPEG file
    2. Repair window
      1. Menu commands
    3. Repair procedure
      1. Visual analysis and localization of damaged MCUs
      2. Finding the next correct MCU
      3. Deleting damaged MCUs
      4. Inserting empty MCUs
      5. Color correction
        1. Automatic color correction
        2. Manual color correction
      6. Filling empty MCUs with data
        1. Use the thumbnail image to fill the empty MCUs
        2. Auto-generate missing content
    4. Saving repaired JPEG image
    5. Repairing fragmented JPEG file
    6. Repairing damaged JPEG image based on SOS marker
    7. Repairing JPEG file encoded by ransomware

Automatic color correction

Automatic color correction works if the damaged fragments are small enough and do not separate the image onto two independent parts. In other words, if the part with correct colors has at least one adjacent MCU with the incorrect part, automatic color correction will work.

For instance, this damaged JPEG image can be color-corrected automatically:

Damaged MCU

And colors on this image cannot be recovered automatically:

Damaged MCU

To apply automatic color correction, select the first MCU of the incorrectly colored part of the image, then click the Auto color button.

If the selected MCU has adjacent MCU with the correct colors, they will be used to calculate colors of the remaining MCUs in the incorrect part of the image. If they are no adjacent MCUs, JpegMedic will calculate colors based on the thumbnail. In this case, accuracy of colors will be lower. If automatic correction resulted in non-ideal final colors, you can adjust them manually.

Important! Automatic color correction is based on data from consequential MCUs starting from the selected MCU to the first empty MCU. If the sequence contains a large number of damaged MCUs this may have negative effect on the work of the algorithm. That is why we recommend to separate damaged MCUs from the correct ones by inserting one empty MCU between the last correct MCU and the first damaged MCU.

Here is an example of such a situation:

Damaged MCU

To make color correction more accurate, we recommend inserting an empty MCU to the end of the correct sequence:

Damaged MCU