This Python script converts JPG images to PNG format using multithreading for improved performance. It can be run as a Python script or as a single standalone Windows executable, supporting both GUI and CLI modes.
- Converts JPG/JPEG images to PNG format
- Uses multithreading for faster processing
- Implements logging for better debugging and monitoring
- Includes error handling and input validation
- Builds as a single standalone Windows executable supporting both GUI and CLI modes
- Resumes interrupted conversions by skipping existing PNG files
A pre-built Windows executable is available for download from the project's GitLab releases page:
Download JPGtoPNGConverter.exe
This executable supports both GUI and CLI modes.
If you want to run the script directly or build the executable yourself, follow these steps:
-
Clone the repository:
git clone https://gitlab.leadingbit.com/raul/jpg2png.git cd jpg2png
-
Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the required dependencies:
pip install -r requirements.txt
-
For GUI mode:
python jpg2png.py
Use the GUI to select source and destination directories, then click "Convert".
-
For CLI mode:
python jpg2png.py /path/to/source /path/to/destination
-
Download
JPGtoPNGConverter.exe
from the releases page or build it yourself usingpython build_exe.py
. -
To use the GUI mode:
- Double-click
JPGtoPNGConverter.exe
, or - Run
JPGtoPNGConverter.exe
from the command line without arguments
- Double-click
-
To use the CLI mode:
JPGtoPNGConverter.exe /path/to/source /path/to/destination
- The script scans the source directory for JPG/JPEG images.
- It checks the destination directory for existing PNG files to avoid unnecessary conversions.
- For each valid JPG image that doesn't have a corresponding PNG, the script converts it to PNG format and saves it in the destination directory.
- The conversion process uses multithreading to improve performance when dealing with multiple images.
- Progress is displayed in real-time, showing the number of files converted and the percentage complete.
- Logging is implemented to track the conversion process and any errors that may occur.
If the conversion process is interrupted, you can simply run the script or executable again with the same source and destination directories. The converter will automatically skip any PNG files that already exist in the destination folder, effectively resuming from where it left off.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the Apache 2.0 License. See LICENSE
for more information.
Raul Pineda
Project Link: https://gitlab.leadingbit.com/raul/jpg2png