Skip to main content

Advanced tool for processing images from the command line

Project description

Image Toolkit App v0.1

Python GitHub

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.


What can Image Toolkit do for you?

  • 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.

Image Toolkit Workflow

  1. 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.
  2. 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.
  3. Script exit:

    • Edited images are saved in the ./new_images folder.

Project Structure (PyPI):

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.)

Requirements

  • Python 3.x
  • Dependencies:
    • Pillow
    • questionary
    • prompt-toolkit
    • prompt
    • setuptools
    • Pygments
    • regex
    • wcwidth
    • six

Install dependencies with:

pip install -r requirements.txt

Usage

Interactive Mode (Local)

Run the script without arguments to start interactive mode:

python src/imagetoolkit/imagetoolkit.py

Interactive Mode (Deb Package - PyPI)

Run the script without arguments to start interactive mode:

imagetoolkit

CLI Mode (Local)

You 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.0

CLI Mode (Deb Package - PyPI)

You 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.0

Contributions

Contributions are welcome! If you want to improve this project, follow these steps:

  1. Fork the repository.
  2. Create a branch with your new feature:
    git checkout -b feature/new-feature
    
  3. Make your changes and commit:
    git commit -m 'Add new feature'
    
  4. Push to the branch:
    git push origin feature/new-feature
    
  5. Open a Pull Request.

License

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! 😊

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

imagetoolkit-0.1.1.tar.gz (20.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

imagetoolkit-0.1.1-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

Details for the file imagetoolkit-0.1.1.tar.gz.

File metadata

  • Download URL: imagetoolkit-0.1.1.tar.gz
  • Upload date:
  • Size: 20.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for imagetoolkit-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d8dfc4c0f052d87d63b48c6c5b4b6c2f43945bf30569502f4a84ce3af83dfc3f
MD5 8ebefaf4dfc309d1fcd99bcdb0c8d0a2
BLAKE2b-256 7aa0dfdf14b479c45a46dee41b487934418584aa6f37066367b94308bbb8f8a8

See more details on using hashes here.

File details

Details for the file imagetoolkit-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: imagetoolkit-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 22.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for imagetoolkit-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a0617fcd2daf97d9b92c6e84e149ce69ef243f1f11c5a059066a94c03e359e44
MD5 92170f9dd8190a847a6e773f9e844162
BLAKE2b-256 31cedb4ac5040714e38f3dc010c42e8f55f5bb2d48ed4a285805963b83ff928b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page