Skip to content

This program converts JPG images in a directory to the PNG format in another directory using multithreading for improved performance. GUI or CLI

License

Notifications You must be signed in to change notification settings

ryvin/JumPing-PeNGuin-JPG-to-PNG-converter

Repository files navigation

JumPinG PeNGuin - JPG to PNG Converter

Jumping Penguin

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.

Features

  • 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

Download

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.

Installation (for development)

If you want to run the script directly or build the executable yourself, follow these steps:

  1. Clone the repository:

    git clone https://gitlab.leadingbit.com/raul/jpg2png.git
    cd jpg2png
    
  2. Create a virtual environment (optional but recommended):

    python -m venv venv
    source venv/bin/activate  # On Windows, use `venv\Scripts\activate`
    
  3. Install the required dependencies:

    pip install -r requirements.txt
    

Usage

As a Python Script

  1. For GUI mode:

    python jpg2png.py
    

    Use the GUI to select source and destination directories, then click "Convert".

  2. For CLI mode:

    python jpg2png.py /path/to/source /path/to/destination
    

As a Windows Executable

  1. Download JPGtoPNGConverter.exe from the releases page or build it yourself using python build_exe.py.

  2. To use the GUI mode:

    • Double-click JPGtoPNGConverter.exe, or
    • Run JPGtoPNGConverter.exe from the command line without arguments
  3. To use the CLI mode:

    JPGtoPNGConverter.exe /path/to/source /path/to/destination
    

How it works

  1. The script scans the source directory for JPG/JPEG images.
  2. It checks the destination directory for existing PNG files to avoid unnecessary conversions.
  3. 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.
  4. The conversion process uses multithreading to improve performance when dealing with multiple images.
  5. Progress is displayed in real-time, showing the number of files converted and the percentage complete.
  6. Logging is implemented to track the conversion process and any errors that may occur.

Resuming Interrupted Conversions

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.

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the Apache 2.0 License. See LICENSE for more information.

Contact

Raul Pineda

Project Link: https://gitlab.leadingbit.com/raul/jpg2png

About

This program converts JPG images in a directory to the PNG format in another directory using multithreading for improved performance. GUI or CLI

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages