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.

The Image Transformation CLI is a pure-Python tool that applies a range of image processing operations directly from your terminal. Every command follows the same three-argument pattern — you supply the command name, the path to your source image, and the directory where you want the result saved. Under the hood each operation is powered by NumPy array manipulations and Matplotlib’s image I/O, so no external image-processing library is required.

General Syntax

python main.py <command> <src> <dest>
ArgumentDescription
<command>One of the 10 subcommands listed below
<src>Path to the input image file (JPEG and PNG are supported)
<dest>Path to the output directory where the result will be saved
All three arguments are required. Passing fewer than three arguments (excluding the command name) prints an error message directing you to --help.

Getting Help

Run either of the following to print the full usage reference in your terminal:
python main.py --help
python main.py -h

Output File Naming

The CLI automatically derives the output filename from the source image. The pattern is:
<stem>_<suffix><extension>
For example, running grayscale on mountains.jpg produces mountains_grayscale.jpg in your chosen output directory. Commands that accept an interactive parameter (such as rotate) embed that value in the suffix (e.g., mountains_rotated_45.jpg).
Several commands pause after loading the image and prompt you to enter a parameter interactively — for example a scaling factor, an angle, or a contrast percentage. The table below marks each such command in the Interactive Prompt column. You must press Enter to confirm your value before the transformation runs.

Command Summary

Commands are grouped into two categories: Color Operations, which alter pixel values without changing image geometry, and Geometric Operations, which reposition or resize pixels in space.

Color Operations

CommandDescriptionInteractive PromptOutput Suffix
grayscaleConverts the image to grayscale using luminosity weighting_grayscale
detect-edgesDetects edges via vertical and horizontal Sobel filters_edge
invert-colorInverts all pixel values to produce a photographic negative_negative
contrastEnhances contrast by percentile clipping and linear rescalingEnter contrast percentage:_contrast
rgb-channelsIsolates one or more RGB channels from the imageEnter channel composition:_channel_<composition>
transparencyAdds an alpha channel and sets a uniform opacity levelEnter transparency percentage:_transparency<percentage>

Geometric Operations

CommandDescriptionInteractive PromptOutput Suffix
flipMirrors the image horizontally_flipped
rotateRotates the image by an arbitrary integer angleEnter angle in degrees:_rotated_<angle>
upscaleEnlarges the image by repeating pixelsEnter scaling factor:_upscaled
downscaleReduces the image by sampling every n-th pixelEnter downscale factor:_downscaled

Explore by Category

Color Transforms

Grayscale, edge detection, invert, contrast, RGB channels, and transparency commands.

Geometric Transforms

Flip and rotate commands for mirroring and arbitrary-angle rotation.

Scaling

Upscale and downscale commands for enlarging or reducing image dimensions.

Build docs developers (and LLMs) love