This project provides two applications for converting and resizing images:
- ImageConverter.exe: A graphical user interface (GUI) application built with PyQt5.
- ImageConverterCLI.exe: A command-line interface (CLI) tool for batch processing images.
Both tools allow users to convert images between different formats and optionally resize them.
The project directory contains:
module/
: Directory containing the image processing logic.cli.py
: Source code for the CLI tool.gui.py
: Source code for the GUI application.requirements.txt
: List of Python dependencies.LICENSE
: License information.README.md
: This file..gitignore
: Git ignore rules.ImageConverter.spec
: PyInstaller spec file for the GUI application.ImageConverterCLI.spec
: PyInstaller spec file for the CLI tool.
The compiled executables for Windows are not included in the repository. Instead, you can download them from the GitHub Releases page:
- Select Image File: Choose an image file from your filesystem.
- Convert Image Format: Convert the selected image to one of the supported formats (JPEG, WebP, PNG, GIF, TIFF, BMP).
- Resize Options: Optionally resize the image before conversion.
- Image Preview: View a preview of the selected image.
- Convert Button: Execute the conversion process.
- Download the zip file from the GitHub Releases page.
- Extract the zip file.
- Run the GUI Application by double-clicking the
ImageConverter.exe
file.
If the icon is missing from the GUI application, download the icon from the GitHub repository and place it under the ./_internal/
directory (that directory should be in the same directory as the executable). It should be named icon.ico
.
- Convert Image Format: Convert images to various formats from the command line.
- Resize Options: Resize images during conversion.
-
Download the executable from the GitHub Releases page.
-
Run the CLI Tool from the command line:
./ImageConverterCLI.exe <input_file> <output_format> [--max-width WIDTH] [--max-height HEIGHT]
<input_file>
: Path to the input image file.<output_format>
: Desired output format (jpeg, webp, png, gif, tiff, bmp).--max-width
: Optional maximum width for resizing.--max-height
: Optional maximum height for resizing.
Example:
./ImageConverterCLI.exe myphoto.png jpeg --max-width 800 --max-height 600
To contribute to the development or modify the applications:
-
Clone the Repository:
git clone <repository-url>
-
Navigate to the Project Directory:
cd <project-directory>
-
Install Dependencies:
pip install -r requirements.txt --ignore-requires-python
-
Run the Applications:
-
GUI Application:
python gui.py
-
CLI Tool:
python cli.py
-
-
Build the Executables:
Use PyInstaller to bundle the applications into standalone executables.
If you do not have PyInstaller installed:
pip install pyinstaller==6.6.0
-
For GUI Application:
pyinstaller ImageConverter.spec
-
For CLI Tool:
pyinstaller ImageConverterCLI.spec
-
-
Test the Executables:
The built executables will be located in the
dist/
directory. Test them to ensure they work as expected.
A special thanks to the following projects that made this tool possible:
- Pillow: A powerful Python Imaging Library used for opening, manipulating, and saving image files. Version 10.2.0.
- PyQt5: A set of Python bindings for Qt libraries used for creating graphical user interfaces. Version 5.15.10.
- PyQtDarkTheme: A library for applying dark themes to PyQt5 applications. Version 2.1.0.
This project is licensed under the MIT License - see the LICENSE file for details.