Author GitHub name: jedahee Author name: Jesús Daza
Image Toolkit is a console application that offers multiple tools for quickly and easily editing one or more images.
- Reduce the size of images.
- Resize and scale.
- Convert file extensions (png, jpg, jpeg...).
- Convert to black and white.
- Apply filters.
- Add text to images.
- Create thumbnails.
-
Script entry:
- Welcome message.
- The user selects an option from the menu.
- The user specifies the path containing the images.
- The user selects the images they want to edit.
-
Depending on the selected option:
- Reduce the size of images:
- Specify the maximum size in KB.
- Option to resize if the image is too large.
- Option to force size reduction, sacrificing quality.
- Resize or scale:
- Warning about quality loss when increasing size.
- Specify width and height or scaling percentage.
- Convert file extensions:
- Select the new format (JPEG, PNG, BMP).
- Option to rename files.
- Apply filters:
- Select a filter from the available catalog.
- Add text to images:
- Specify text, font, color, and position.
- Create thumbnails:
- Select the thumbnail size.
- Option to convert to .ICO format for favicons.
- Reduce the size of images:
-
Script exit:
- Edited images are saved in the
./new_imagesfolder.
- Edited images are saved in the
imagetoolkit/
├── src/ # Main module of the tool
│ ├── imagetoolkit/
│ ├── __init__.py # Package initializer
│ ├── cli.py # Code for the command-line interface (arguments and execution)
│ ├── imagetoolkit.py # Main file
│ ├── compress.py # Functions for resizing/compressing images
│ ├── rescale.py # Functions related to resizing images
│ ├── extension.py # Functions for editing the name and extension of images
│ ├── color.py # Functions for manipulating colors (color adjustments, black & white, etc.)
│ ├── addtext.py # Functions for adding text to images
│ ├── utils.py # Auxiliary functions and general tools (e.g., path validation, error handling)
│ └── variables.py # Global variables
├── requirements.txt # Project dependencies (Pillow, click, etc.)
├── README.md # Project documentation
├── setup.py # Package configuration if you plan to distribute it
└── .gitignore # Files to ignore in version control (environment, etc.)
- Python 3.x
- Dependencies:
Pillowquestionaryprompt-toolkitpromptsetuptoolsPygmentsregexwcwidthsix
Install dependencies with:
pip install -r requirements.txtRun the script without arguments to start interactive mode:
python src/imagetoolkit/imagetoolkit.pyRun the script without arguments to start interactive mode:
imagetoolkitYou can use the command-line interface by passing arguments. Example:
python src/imagetoolkit/imagetoolkit.py reduce --input ./img --output ./compressed --max-size 1024KB --resize --quality
python src/imagetoolkit/imagetoolkit.py resize --input ./img --output ./resized --mode fixed --dimensions 800 600
python src/imagetoolkit/imagetoolkit.py convert --input ./img --output ./converted --format PNG --rename --basename newimage
python src/imagetoolkit/imagetoolkit.py filter --input ./img --output ./filtered --filter grayscale
python src/imagetoolkit/imagetoolkit.py add-text --input ./img --output ./with-text --text 'Watermark' --color white --position 'Bottom Right' --size 5.0You can use the command-line interface by passing arguments. Example:
imagetoolkit reduce --input ./img --output ./compressed --max-size 1024KB --resize --quality
imagetoolkit resize --input ./img --output ./resized --mode fixed --dimensions 800 600
imagetoolkit convert --input ./img --output ./converted --format PNG --rename --basename newimage
imagetoolkit filter --input ./img --output ./filtered --filter grayscale
imagetoolkit add-text --input ./img --output ./with-text --text 'Watermark' --color white --position 'Bottom Right' --size 5.0Contributions are welcome! If you want to improve this project, follow these steps:
- Fork the repository.
- Create a branch with your new feature:
git checkout -b feature/new-feature
- Make your changes and commit:
git commit -m 'Add new feature' - Push to the branch:
git push origin feature/new-feature
- Open a Pull Request.
This project is licensed under the Creative Commons Zero v1.0 Universal License. See the LICENSE file for details.
Thank you for using Image Toolkit! 😊