Most problems with Image Transformation fall into one of three categories: incorrect CLI usage, a missing or misspelled file path, or an environment issue where dependencies are not installed. The sections below cover every common error message you might encounter, its root cause, and the exact steps to fix it.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.
Error: Missing Arguments (too few or too many args)
Error: Missing Arguments (too few or too many args)
main.py. The dispatcher requires exactly three: a command, a source path, and a destination directory. The exact error printed to the console is:python main.py --help to see the full list of commands and the expected syntax.Error: Invalid arguments (unrecognised command)
Error: Invalid arguments (unrecognised command)
detect-edges, grayscale, upscale, downscale, flip, rotate, invert-color, contrast, rgb-channels, transparency.Common mistakes:FileNotFoundError when loading the image
FileNotFoundError when loading the image
src path you provided does not point to an existing file. matplotlib.image.imread() raises a FileNotFoundError if the file cannot be found at the resolved absolute path.Fix: Verify that the file exists and that the path is correct relative to the directory you are running the command from (the project root). Use an absolute path if you are unsure:mountains.jpg and Mountains.jpg are different files.Output directory does not exist / FileNotFoundError on save
Output directory does not exist / FileNotFoundError on save
dest directory path you specified does not exist. Image Transformation calls matplotlib.image.imsave() with the fully constructed output path, but it does not create intermediate directories. If any part of the destination path is missing, the save will fail.Fix: Create the output directory before running the command:ModuleNotFoundError: No module named 'numpy' (or 'matplotlib')
ModuleNotFoundError: No module named 'numpy' (or 'matplotlib')
python main.py outside the virtual environment, Python uses the system interpreter, which may not have numpy or matplotlib installed.Fix: Activate the virtual environment and install dependencies:(.venv) before the path. Then retry your command.Transparency output looks fully opaque (no transparency visible)
Transparency output looks fully opaque (no transparency visible)
.jpg or .jpeg). The transparency command writes a 4-channel RGBA array into self.outp, but when Matplotlib saves the file it detects a JPEG extension and discards the alpha channel. The result is an opaque image regardless of the percentage you entered.Fix: Use a PNG source image so that the output file (which inherits the source extension) is also saved as PNG, preserving the alpha channel:rgb-channels keeps re-prompting 'Invalid input composition'
rgb-channels keeps re-prompting 'Invalid input composition'
^r?g?b?$. The tool requires the channels to be specified as a combination of the lowercase letters r, g, and b in exactly that order. Uppercase letters, spaces, repeated letters, or any other character will all be rejected.Fix: Enter one of the seven valid compositions:| Input | Channels kept | Effect |
|---|---|---|
r | Red only | Red tint |
g | Green only | Green tint |
b | Blue only | Blue tint |
rg | Red + Green | Yellow tint (no blue) |
rb | Red + Blue | Magenta tint (no green) |
gb | Green + Blue | Cyan tint (no red) |
rgb | All channels | Original colours |
Rotation output has black borders or gaps around the image
Rotation output has black borders or gaps around the image
-
Rotate by a multiple of 90° —
90,180, or270degrees produce no empty canvas regions because the bounding box does not grow. - Crop the output manually after rotating, using an external image editor or a Python script:
os.system('start ...') does nothing on Linux or macOS
os.system('start ...') does nothing on Linux or macOS
main.py calls os.system(f"start {sys.argv[3]}") to open the destination folder. start is a Windows Command Prompt built-in; it has no equivalent under the same name on Linux or macOS, so the call exits silently without opening anything.Fix: This only affects the auto-open behaviour — the image is saved correctly regardless. To view the output, open it manually: