Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Adarsh275/Image-Transformation/llms.txt

Use this file to discover all available pages before exploring further.

Image Transformation ships with platform-specific setup scripts that handle virtual environment creation and dependency installation in a single command. The guide below walks you through cloning the repository, running the appropriate script for your platform, activating the environment, and verifying that the tool is ready to use. A manual fallback is also provided for environments where the scripts cannot be run directly.

Prerequisites

Before you begin, make sure the following are available on your system:
  • Python 3.8 or later — the codebase uses f-strings and NumPy features that require Python 3.8+. Verify with python --version or python3 --version.
  • pip — Python’s package installer, bundled with most Python distributions. Verify with pip --version.
  • Git — to clone the repository. Verify with git --version.

Installation Steps

1

Clone the repository

Clone the Image Transformation repository from GitHub and change into the project directory:
git clone https://github.com/Adarsh275/Image-Transformation.git
cd Image-Transformation
2

Run the setup script for your platform

The setup script installs virtualenv, creates a .venv virtual environment in the project directory, activates it, and installs all dependencies from requirements.txt.
bash setup.sh
The script creates .venv/, activates it, then runs pip install -r requirements.txt automatically. You will see green status messages for each step.
3

Activate the virtual environment

The setup script activates the environment during installation, but you will need to re-activate it in any new terminal session before running main.py.
source .venv/bin/activate
Once activated, your terminal prompt will be prefixed with (.venv) to confirm the environment is active.
4

Verify the installation

Confirm that all dependencies were installed correctly and the CLI is functional:
python main.py --help
You should see the full usage message:
Usage:
    python main.py <Option> src dest
    
Option:
    --help      -h      Loads this message
    detect-edges        Perform edge detection on given image
    grayscale           Convert image to grayscale
    upscale             Upscale image
    downscale           Downscale image
    flip                Flips the image
    rotate              Rotate image by given angle
    invert-color        Invert colors of the image
    contrast            To adjust contrast of image
    rgb-channels        To obtain image containg only r,g or b or a mixture of those
    transparency        To add transparency to images


src - source of image
dest - destination location to save image
If you see this output, Image Transformation is installed and ready to use.

What Gets Installed

The requirements.txt pins the following packages (key ones highlighted):
PackageVersionPurpose
numpy1.22.3All pixel-level array operations and matrix math
matplotlib3.5.1Image reading (mpimg.imread) and saving (mpimg.imsave)
Pillow9.1.0Image format support used by Matplotlib’s image backend
cycler0.11.0Matplotlib dependency
fonttools4.32.0Matplotlib dependency
kiwisolver1.4.2Matplotlib dependency
packaging21.3Matplotlib dependency
pyparsing3.0.8Matplotlib dependency
python-dateutil2.8.2Matplotlib dependency
six1.16.0Transitive dependency
NumPy and Matplotlib are the two libraries your code directly imports — the rest are transitive dependencies pulled in by Matplotlib.

Manual Installation (Fallback)

Use the manual steps below if you cannot run the provided scripts — for example, if you are on a system where shell scripts are restricted, or if you prefer to use a venv instead of virtualenv.
# Create a standard Python virtual environment
python -m venv venv

# Activate it (Linux/macOS)
source venv/bin/activate

# Activate it (Windows PowerShell)
# venv\Scripts\Activate.ps1

# Install all dependencies
pip install -r requirements.txt
After activation, verify with python main.py --help as shown in Step 4 above.

Build docs developers (and LLMs) love