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

Auto-generate missing content

A viable alternative to using thumbnails to fill in the missing parts of the JPEG image after removing damaged MCU blocks is auto-generation of content.

Many contemporary graphical editors like Photoshop or Paint.NET have a powerful instrument - Content-Aware Healing. While the tool itself can work differently in different software, the idea of the method is to use content-aware healing to restore missing parts of the image.

Please take into account that the procedure and the final result may be different if other software is used. Make sure to read the documentation of your product to learn more about content-aware image healing.

Below is the example of auto-generation of content in Paint.NET.

First of all, you need to install the Content Aware Fill plugin for Paint.NET. You can download it from the official forum of the Paint.NET software using this link.

To pass the image from JpegMedic to Paint.NET, use the clipboard. Use the File > Copy to clipboard menu command. Then, in Paint.NET use the File > New menu to create a new file. Paint.NET automatically determines there's an image in the clipboard and will set the size of the image accordingly. Do not change anything and click OK.

PaintNET New

Then, use Edit > Paste to paste the image from the clipboard to the canvas.

PaintNET Paste

To generate content automatically, select the empty areas on the image. The best way to do this is to use the Magic Wand tool.

PaintNET Magic Wand

Now, run auto-generation of content using the Effects > Selection > Content Aware Fill menu command, and Paint.NET will fill in the gaps automatically.

PaintNET Content Aware Fill

The tool does not always produce the best results, but that's still much better than nothing.

Once the image is restored, you can save it. If you want, you can save directly from Paint.NET, but in this case metadata such as EXIF data of the original file will be lost. The image will be re-encoded again and may suffer a minor loss of the quality.

Instead, we recommend doing the following:

  1. Copy the resulting image to the clipboard.
  2. Switch back to JpegMedic application.
  3. Use the Thumbnails > Paste from clipboard menu command. JpegMedic will add the image in the clipboard received from Paint.NET to the list of thumbnails. The size of this thumbnail will be the same as the size of the original image.
  4. Select this thumbnail in the Thumbnail list. The program will automatically use it to fill the empty MCUs when you save the restored image.