This guide assumes you have already installed Image Transformation and have an active virtual environment. If you have not done that yet, complete the Installation guide first, then come back here. All examples below use the sample images that ship inside theDocumentation 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.
Input_Image/ directory of the repository, so you can run every command exactly as written without needing your own image files.
CLI Syntax
Every Image Transformation command follows the same three-argument pattern:<command>— one of the ten transformation subcommands (see the table in the Introduction)<src>— full or relative path to the source image file (JPEG, PNG, etc.)<dest>— path to the output directory where the processed image will be saved
<original-stem>_<suffix><original-extension>. For example, running grayscale on mountains.jpg produces mountains_grayscale.jpg in the destination directory.
Six commands —
upscale, downscale, rotate, contrast, rgb-channels, and transparency — pause after you run them and prompt you to enter an additional parameter interactively (a scale factor, rotation angle, contrast percentage, channel string, or transparency percentage). The other four commands (detect-edges, grayscale, flip, invert-color) run to completion without any further input.Quickstart Walkthrough
Convert a photo to grayscale
The Expected terminal output:Output file:
grayscale command uses the luminosity formula (R×0.299 + G×0.587 + B×0.114) to convert a colour image to a perceptually-weighted grayscale representation. It requires no additional input.Output_Image/mountains_grayscale.jpgRun edge detection on a photo
The Expected terminal output:Output file:
detect-edges command applies vertical and horizontal Sobel convolution kernels to identify edges in the image. Like grayscale, it runs entirely non-interactively.Output_Image/building_edge.jpgThe algorithm internally calls grayscale() first, then applies the Sobel kernels to the single-channel result. Edge scores are normalised to the [0, 1] range before saving.Output Filename Reference
The output filename is always built from the source file’s stem plus a fixed suffix:| Command | Suffix appended | Example output filename |
|---|---|---|
detect-edges | _edge | building_edge.jpg |
grayscale | _grayscale | mountains_grayscale.jpg |
upscale | _upscaled | mountains_upscaled.jpg |
downscale | _downscaled | mountains_downscaled.jpg |
flip | _flipped | car_flipped.jpeg |
rotate | _rotated_<angle> | car_rotated_90.jpeg |
invert-color | _negative | building_negative.jpg |
contrast | _contrast | mountains_contrast.jpg |
rgb-channels | _channel_<channels> | mountains_channel_rg.jpg |
transparency | _transparency<percentage> | mountains_transparency50.0.jpg |
The --help Output
Run python main.py --help (or python main.py -h, or python main.py with no arguments) to see the full usage reference at any time:
Interactive Commands: What to Expect
When you run one of the six interactive commands, the program halts and waits for you to type a value. Here is what each prompt looks like and what kind of input is expected:| Command | Prompt | Expected input |
|---|---|---|
upscale | Enter scaling factor: | Positive integer (e.g. 2 doubles the resolution) |
downscale | Enter downscale factor: | Positive integer (e.g. 2 halves the resolution) |
rotate | Enter angle in degrees: | Integer angle in degrees (e.g. 90, 45, 180) |
contrast | Enter contrast percentage: | Integer 0–100 (e.g. 80) |
rgb-channels | Enter channel composition: | Letters r, g, b in that order (e.g. r, rg, rgb, gb); validated against regex ^r?g?b?$ |
transparency | Enter transparency percentage: | Float 0–100 (e.g. 50.0 gives 50% opacity) |
Next Steps
Command Reference
Detailed documentation for every subcommand — arguments, interactive prompts, output naming, and edge cases.
API Reference
Explore the
imageEdit class internals, method signatures, and the NumPy algorithms behind each transformation.