Skip to content

Python GUI application using PyQt6 for repairing corrupted JPEG images by shifting MCU and applying auto color enhancements.

License

Notifications You must be signed in to change notification settings

DRCRecoveryData/JPEG-Repair-Tool

Repository files navigation

🖼️ JPEG Repair Tool

A User-Friendly GUI Application to Fix Corrupted and Encrypted JPEG Images

Python PyQt6 License Release


📸 Overview

This application provides a simple, graphical user interface (GUI) built with Python and PyQt6 to effectively repair JPEG images that have been corrupted, often as a result of ransomware encryption (like Stop/DJVU) or other file-level damage.

The tool works by intelligently determining and applying the correct Minimum Coded Unit (MCU) shift using a reference image, and then offers an optional auto-color enhancement to restore image quality.

Before Repair After Repair
Corrupted JPEG Image Repaired JPEG Image

✨ Features

  • MCU Shift Repair: Automatically calculates and applies the necessary MCU shift to repair the header structure of corrupted JPEGs.
  • Batch Processing: Repair multiple corrupted images within a specified folder using a single reference image.
  • Auto Color Enhancement: Optional post-repair feature to automatically improve the color, contrast, and brightness of the restored images.
  • Intuitive GUI: Easy-to-use interface powered by PyQt6.

🚀 Get Started

Prerequisites

You need Python 3.x installed on your system.

Installation

  1. Clone the repository or download the latest release:

    git clone https://github.com/DRCRecoveryData/JPEG-Repair-Tool.git
    cd JPEG-Repair-Tool
  2. Install the required dependencies (PyQt6, NumPy, Pillow):

    pip install -r requirements.txt

    Alternatively, you can install them manually:

    pip install pyqt6 numpy pillow

Usage

  1. Run the application:
    python jpeg_repair_tool.py
  2. Select Files:
    • Click the button to select one known-good reference JPEG (an uncorrupted image from the same camera/source).
    • Click the button to select the folder containing the encrypted/corrupted JPEGs.
  3. Repair: Click "Repair JPEGs" to start the batch repair process.
  4. Enhance (Optional): Click "Auto Color" to apply automatic color correction to the newly repaired images.

🛠️ How It Works

The core of the repair process involves MCU (Minimum Coded Unit) alignment. Many forms of file corruption, particularly those from simple encryption methods, often corrupt the file header, causing a shift in the data blocks. The tool leverages a known-good reference file to calculate the correct header offset (MCU shift) and applies this correction to the corrupted files, effectively restoring the image data structure and making the image viewable again.


🤝 Contributing

We welcome contributions, bug reports, and suggestions!

  1. Fork the repository.
  2. Create a new feature branch.
  3. Commit your changes.
  4. Push to the branch.
  5. Open a Pull Request.

For major changes, please open an issue first to discuss what you would like to change.


📄 License

This project is licensed under the GNU General Public License (GPL). See the LICENSE file for more details.


✉️ Contact

For professional support, questions, or inquiries, feel free to reach out:

📧 Email: [email protected] 🔗 GitHub: DRCRecoveryData

About

Python GUI application using PyQt6 for repairing corrupted JPEG images by shifting MCU and applying auto color enhancements.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages