This Python script efficiently converts HEIC (High-Efficiency Image Format) files to JPG format, now with parallel processing for faster conversions, enhanced user experience, and automatic preservation of EXIF metadata.
- Parallel Processing: Utilizes
ThreadPoolExecutor
for concurrent conversion of HEIC files, improving the speed of batch conversions. - Command-Line Interface (CLI): Interact with the script directly using command-line arguments for easier execution and fine-tuning.
- Optimized Image Processing: Leverages the
pillow-heif
library for efficient HEIC processing. - Improved Error Handling: More robust error management ensures smoother execution.
- Progress Tracking: Track the conversion progress for large file sets.
- Enhanced Folder Management: Confirms user intent before potentially overwriting existing output directories.
- Quality Control: Customize the output JPG quality (1-100) with a simple command-line option.
- EXIF Metadata Preservation: Retains important metadata such as camera details, timestamps, and location information in the converted JPG files.
This script allows you to seamlessly convert multiple HEIC files into JPG format with control over the quality and parallel processing options.
- Automated Output Directory: Creates a dedicated folder named "ConvertedFiles" within the HEIC directory to store the converted JPGs.
- Parallel Conversion: Process multiple files simultaneously by specifying the number of workers using the
-w
argument. - Quality Control: Specify the desired JPG image quality using the
-q
argument. - EXIF Metadata Preservation: Automatically extracts and includes metadata from HEIC files into the output JPGs.
- Error Handling: Skips individual files that encounter errors without halting the entire process.
- Install the required dependency:
pip install pillow pillow-heif
- Run the Script:
python main.py <path/to/your/heic/directory>
python main.py -q 90 <path/to/your/heic/directory>
python main.py -w 8 <path/to/your/heic/directory>
python main.py -q 90 -w 8 <path/to/your/heic/directory>
- Parallel Processing: Convert multiple HEIC files concurrently for faster performance.
- User-friendly CLI for efficient conversion.
- Optimized HEIC processing for faster performance.
- Robust error handling for a smooth user experience.
- Informative progress tracking.
- Flexible output directory management.
- Quality control for JPG output.
- EXIF Metadata Preservation: Retains critical metadata like camera details, timestamps, and location data in the converted files.
This script provides a highly efficient and flexible solution for converting HEIC images to JPG format, making it ideal for both small and large-scale conversions.