███╗ ███╗████████╗
████╗ ████║╚══██╔══╝
██╔████╔██║ ██║
██║╚██╔╝██║ ██║
╚═╝ ╚═╝ ╚═╝
Multi Tools CLI
A unified Python CLI and library combining a full-featured PDF toolkit (19 commands) and image processing suite (21 commands) — with automatic platform detection for Android, Linux, macOS, and Windows.
✓ Python 3.9+
⚡ 40 Commands
🤖 Android Ready
MIT License
pip install multi-tools-cli
Installation
Install via pip — choose the extras you need
bash — core
# Core install (PDF + Image)
$ pip install .
# With OCR support
$ pip install ".[ocr]"
# Everything
$ pip install ".[all]"
bash — android
# Pydroid3 / Termux
$ pip install . --break-system-packages
# Termux — install Tesseract first
$ pkg install tesseract
$ pip install ".[ocr]" --break-system-packages
Optional extras:
[ocr] adds pytesseract · [tables] adds pdfplumber · [bg-remove] adds requests · [pdf-images] adds flask · [all] installs everything.
Quick Start
Start using mt immediately after install
bash
# Check everything is working
$ mt --help
$ mt --platform # shows detected platform + Tesseract path
# PDF examples
$ mt pdf compress report.pdf --quality 55 --scale 0.6
$ mt pdf merge a.pdf b.pdf c.pdf -o combined.pdf
$ mt pdf ocr scanned.pdf --lang eng
# Image examples
$ mt image compress photo.jpg -q 80 -f WEBP
$ mt image resize photo.jpg --width 800
$ mt image ocr scan.png --lang urd
python — library
from multi_tools import pdf
from multi_tools import image
# PDF
pdf.compress("report.pdf", "out.pdf", quality=55)
pdf.merge(["a.pdf", "b.pdf"], "combined.pdf")
pdf.ocr("scanned.pdf", "out.txt", lang="eng")
# Image
image.main(["compress", "photo.jpg", "-q", "80"])
image.main(["resize", "photo.jpg", "--width", "800"])
Platforms
Auto-detected on startup — Tesseract paths resolved automatically
Pydroid 3
Android app
pip install . \
--break-system-packages
Tesseract: auto-detected at
/data/user/0/ru.iiec.pydroid3/
app_HOME/tesseract
Config: /sdcard/mt/config.json
Termux
Android terminal
pkg install tesseract
pip install ".[ocr]" \
--break-system-packages
Tesseract: $PREFIX/bin/tesseract
Config: /sdcard/mt/config.json
Linux
Ubuntu / Debian / Fedora
sudo apt install tesseract-ocr
pip install ".[all]"
Tesseract: /usr/bin/tesseract
Config: ~/.mt/config.json
macOS
Intel + Apple Silicon
brew install tesseract
pip install ".[all]"
Tesseract: /opt/homebrew/bin/
tesseract (M1/M2)
Config: ~/.mt/config.json
Windows
Windows 10 / 11
Download Tesseract installer
from UB-Mannheim/tesseract
pip install ".[all]"
mt -config set pdf.tesseract_cmd \
"C:\Program Files\Tesseract..."
PDF Tool — 19 Commands
Full-featured PDF processing: compress, merge, split, watermark, OCR, tables, and more
compress
merge
split
rotate
watermark
encrypt
info
ocr
extract-text
page-numbers
header-footer
repair
redact
extract-images
images-to-pdf
pdf-to-md
remove-blank
pdf-to-images
extract-tables
compress
📄 mt pdf compress
Reduces PDF file size using a smart two-phase compression engine. Phase 1 resamples and re-encodes all embedded raster images at a lower resolution and JPEG quality. Phase 2 deflates uncompressed content streams with zlib FlateDecode. Works on text-only, image-only, and mixed PDFs.
mt pdf compress <input.pdf> [options]
-o, --output FILE Output PDF path
--scale 0.0–1.0 Image scale factor (default: 0.5)
--quality 1–95 JPEG quality for images (default: 60)
Examples:
mt pdf compress report.pdf --quality 55 --scale 0.6
mt pdf compress scan.pdf -o compressed.pdf
--scale--quality-o
merge
📑 mt pdf merge
Combines two or more PDF files into a single document, preserving all pages in the order provided. Handles encrypted and damaged PDFs gracefully.
mt pdf merge <file1.pdf> <file2.pdf> [...] [options]
-o, --output FILE Output PDF path
Examples:
mt pdf merge a.pdf b.pdf c.pdf -o combined.pdf
mt pdf merge chapter*.pdf -o book.pdf
split
✂️ mt pdf split
Extracts a specific set of pages from a PDF using a flexible page specification. Supports ranges, individual pages, and combinations. Pages are 1-indexed.
mt pdf split <input.pdf> --pages SPEC [options]
-p, --pages SPEC Page spec: ranges and single pages
e.g. "1-3,5,8-10"
-o, --output FILE Output PDF path
Examples:
mt pdf split doc.pdf --pages 1-3,5,8-10
mt pdf split doc.pdf -p 2-4 -o extract.pdf
rotate
🔄 mt pdf rotate
Rotates every page of a PDF clockwise by 90, 180, or 270 degrees. Useful for correcting scanned documents that were saved in the wrong orientation.
mt pdf rotate <input.pdf> [options]
-a, --angle DEG 90, 180, or 270 (default: 90)
-o, --output FILE Output PDF path
Examples:
mt pdf rotate scan.pdf --angle 90
mt pdf rotate sideways.pdf -a 270 -o fixed.pdf
watermark
💧 mt pdf watermark
Stamps a diagonal semi-transparent text watermark onto every page of a PDF, centered on the page. Uses Helvetica-Bold at 50pt with 50% opacity. Common uses: CONFIDENTIAL, DRAFT, DO NOT COPY.
mt pdf watermark <input.pdf> --text TEXT [options]
-t, --text TEXT Watermark text (required)
-o, --output FILE Output PDF path
Examples:
mt pdf watermark report.pdf --text "CONFIDENTIAL"
mt pdf watermark doc.pdf --text "DRAFT" -o draft.pdf
encrypt
🔒 mt pdf encrypt
Password-protects a PDF file using AES encryption. The encrypted file requires the password to open in any PDF viewer. Keep your password safe — there is no recovery mechanism.
mt pdf encrypt <input.pdf> --password PASS [options]
-p, --password PASS Password string (required)
-o, --output FILE Output PDF path
Examples:
mt pdf encrypt report.pdf --password s3cr3t
mt pdf encrypt doc.pdf -p "my password" -o secure.pdf
There is no built-in password recovery. Store your password securely.
info
ℹ️ mt pdf info
Displays detailed metadata and statistics for a PDF: file size, page count, page dimensions, document metadata (title, author, creator), creation and modification dates, encryption status, and an estimated word count sampled from the first 5 pages.
mt pdf info <input.pdf>
Examples:
mt pdf info report.pdf
mt pdf info scanned_book.pdf
ocr
🔍 mt pdf ocr
Smart text extractor that automatically detects whether a PDF is text-based or scanned. For text-based PDFs it uses pypdf's fast built-in extraction (no Tesseract needed). For scanned/image PDFs it falls back to Tesseract OCR on embedded images. Saves a full .txt report and prints a terminal preview. Tesseract path is auto-detected per platform.
mt pdf ocr <input.pdf> [options]
-o, --output FILE Output .txt path
--lang LANG Tesseract language (default: eng)
Multi: --lang eng+urd
--preview N Pages to preview in terminal (default: 2)
--tesseract-cmd PATH Override Tesseract binary path
--tessdata-prefix PATH Override tessdata folder
Examples:
mt pdf ocr scanned.pdf --lang eng
mt pdf ocr arabic.pdf --lang ara -o arabic.txt
mt pdf ocr scan.pdf --lang eng+urd --preview 3
Requires
pip install pytesseract and Tesseract installed. On Pydroid3 the path is auto-detected. Set manually with mt -config set pdf.tesseract_cmd /path/to/tesseractextract-text
📝 mt pdf extract-text
Dumps all extractable text from a PDF into a structured .txt report. The report includes per-page headers with word and character counts, and a summary section with totals and averages. Best for text-based PDFs — for scanned documents use
ocr instead.mt pdf extract-text <input.pdf> [options]
-o, --output FILE Output .txt path
Examples:
mt pdf extract-text report.pdf
mt pdf extract-text book.pdf -o book_text.txt
page-numbers
🔢 mt pdf page-numbers
Stamps page numbers onto every page of a PDF at any of six positions. Supports custom starting number, prefix/suffix text, and font size. Numbers are overlaid as a transparent PDF layer so the original content is untouched.
mt pdf page-numbers <input.pdf> [options]
--position POS bottom-center (default), bottom-left,
bottom-right, top-center, top-left, top-right
--start N Starting number (default: 1)
--prefix TEXT Text before number e.g. "Page "
--suffix TEXT Text after number e.g. "."
--font-size N Font size in pts (default: 12)
-o, --output FILE
Examples:
mt pdf page-numbers doc.pdf --position top-right --start 1
mt pdf page-numbers doc.pdf --prefix "Page " --suffix " of 10"
header-footer
📋 mt pdf header-footer
Adds a header and/or footer text to every page with a subtle separator line. Supports
{page} and {total} tokens for dynamic page numbering. At least one of --header or --footer must be provided.mt pdf header-footer <input.pdf> [options]
--header TEXT Header text (supports {page} and {total})
--footer TEXT Footer text (supports {page} and {total})
--font-size N Font size in pts (default: 11)
-o, --output FILE
Examples:
mt pdf header-footer doc.pdf \
--header "My Company — Confidential" \
--footer "Page {page} of {total}"
repair
🔧 mt pdf repair
Attempts to recover a corrupted or damaged PDF by reading it in non-strict mode and rewriting all successfully parsed pages to a new file. Reports how many pages were recovered vs. skipped. Preserves document metadata where possible.
mt pdf repair <input.pdf> [options]
-o, --output FILE Output PDF path
Examples:
mt pdf repair damaged.pdf
mt pdf repair broken.pdf -o recovered.pdf
redact
⬛ mt pdf redact
Blacks out sensitive keywords on every page by overlaying opaque black rectangles over matched text regions. Case-insensitive matching. Multiple keywords can be redacted in a single pass. Best for text-based PDFs — scanned PDFs require OCR first.
mt pdf redact <input.pdf> --keywords WORD [...] [options]
-k, --keywords WORD One or more keywords/phrases to redact
-o, --output FILE Output PDF path
Examples:
mt pdf redact doc.pdf -k "John Smith" "SSN" "password"
mt pdf redact report.pdf --keywords "salary" "confidential"
extract-images
🖼️ mt pdf extract-images
Pulls all embedded raster images out of a PDF and packages them into a ZIP archive. Images smaller than the minimum width/height threshold are skipped (prevents extracting tiny icons or decorations). Output images are saved as PNG.
mt pdf extract-images <input.pdf> [options]
--min-width N Minimum image width in px (default: 300)
--min-height N Minimum image height in px (default: 300)
-o, --output FILE Output .zip path
Examples:
mt pdf extract-images report.pdf
mt pdf extract-images book.pdf --min-width 200 -o images.zip
images-to-pdf
🗂️ mt pdf images-to-pdf
Converts one or more image files (JPEG, PNG, BMP, TIFF, WebP) into a multi-page PDF. Each image becomes one page. Images are scaled to fit the chosen page size with configurable margins. Supports standard page sizes and custom DPI for print quality control.
mt pdf images-to-pdf <img1> <img2> [...] [options]
--page-size SIZE a4 (default), a3, a5, letter
--margin PTS Border margin in points (default: 20)
72 pts = 1 inch
--dpi DPI Image quality: 150=good, 200=default, 300=print
-o, --output FILE Output PDF path
Examples:
mt pdf images-to-pdf photo1.jpg photo2.png -o album.pdf
mt pdf images-to-pdf scan*.jpg --page-size a4 --dpi 300
pdf-to-md
📖 mt pdf pdf-to-md
Converts PDF text content to a structured Markdown file. Uses spatial layout extraction to detect headings (numbered/emoji-prefixed lines), tables (column-aligned blocks), bullet lists, and paragraphs. Hyphen-broken words across lines are rejoined. Output includes a YAML-style document header.
mt pdf pdf-to-md <input.pdf> [options]
-o, --output FILE Output .md path
Examples:
mt pdf pdf-to-md report.pdf
mt pdf pdf-to-md paper.pdf -o paper.md
remove-blank
🧹 mt pdf remove-blank
Scans every page and removes pages that contain fewer words than the threshold AND no embedded images. Useful for cleaning up scanned documents that produced empty pages. Reports which pages were removed.
mt pdf remove-blank <input.pdf> [options]
--text-threshold N Pages with fewer than N words are blank
(default: 10)
-o, --output FILE Output PDF path
Examples:
mt pdf remove-blank scan.pdf
mt pdf remove-blank doc.pdf --text-threshold 5
pdf-to-images
📸 mt pdf pdf-to-images
Converts PDF pages to image files. Two modes: Default (browser) — uses a local Flask server + pdf.js to render every page as a pixel-perfect screenshot (works for text, mixed, and scanned PDFs). Embedded (-e) — extracts raw XObject images directly from scanned PDFs without Flask.
mt pdf pdf-to-images <input.pdf> [options]
--fmt FORMAT jpg (default) or png
-e, --embedded XObject extraction mode (no Flask needed)
Best for scanned/image-only PDFs
--setup Re-download local pdf.js assets
-o, --output DIR Output folder
Examples:
mt pdf pdf-to-images book.pdf # browser render
mt pdf pdf-to-images scan.pdf -e # embedded mode
mt pdf pdf-to-images book.pdf --fmt png
Default mode requires
pip install flask. pdf.js assets are downloaded once on first use and cached locally — works offline after that.extract-tables
📊 mt pdf extract-tables
Detects and extracts all tables from a PDF, saving each as a separate CSV file. Uses pdfplumber for accurate table boundary detection. Each CSV is named by page number and table index. Requires
pip install pdfplumber.mt pdf extract-tables <input.pdf> [options]
-o, --output DIR Output folder for CSV files
Examples:
mt pdf extract-tables data.pdf
mt pdf extract-tables report.pdf -o ./tables/
Image Tool — 21 Commands
Compress, resize, watermark, collage, OCR, steganography, ASCII art, color tools, and more
compress
resize
thumbnail
watermark
stitch
collage
metadata
bg-remove
histogram
dominant-color
ocr
duplicates
hide / reveal
ascii
beautify
color tools
compress
🗜️ mt image compress
Compresses images to JPEG, WebP, or PNG format with configurable quality. Supports batch processing with glob patterns. Displays before/after file sizes and compression percentage for each file. Output is auto-named next to the source.
mt image compress <image(s)> [options]
-q, --quality N Quality 10-100 for JPEG/WebP (default: 75)
-f, --format FMT JPEG, WEBP, or PNG (default: JPEG)
-o, --output FILE Custom output path (single file only)
Examples:
mt image compress photo.jpg -q 80 -f WEBP
mt image compress *.jpg -q 70
mt image compress photo.png -f PNG -o small.png
resize
↔️ mt image resize
Resizes images by width, height, scale percentage, or both dimensions. Preserves aspect ratio by default when only one dimension is given. Supports batch processing. Use --no-aspect to stretch to exact dimensions.
mt image resize <image(s)> [options]
-W, --width PX Target width in pixels
-H, --height PX Target height in pixels
-s, --scale PCT Scale by percentage (overrides width/height)
--no-aspect Allow stretching (both --width and --height)
-o, --output FILE Custom path (single file only)
Examples:
mt image resize photo.jpg --width 800
mt image resize photo.jpg --width 1920 --height 1080
mt image resize *.jpg --scale 50
mt image resize banner.jpg -W 1200 -H 400 --no-aspect
thumbnail
🔲 mt image thumbnail
Generates multiple thumbnail sizes from one or more source images in a single command. Each size is saved as a separate file named with its pixel dimension. Ideal for web development workflows requiring multiple icon or preview sizes.
mt image thumbnail <image(s)> [options]
--sizes N,N,... Comma-separated sizes in pixels
(default: 128,256,512)
-o, --output FILE Custom path (single file + single size only)
Examples:
mt image thumbnail photo.jpg --sizes 128,256,512
mt image thumbnail logo.png --sizes 16,32,64,128,256
watermark
💧 mt image watermark
Adds a text or logo watermark to images at any of nine positions. Text watermarks are rendered with a configurable font size and opacity. Logo watermarks scale relative to the image width. Supports batch processing.
mt image watermark <image(s)> [options]
--text TEXT Text watermark string e.g. "© 2026"
--logo FILE Logo image file (PNG recommended)
--position POS top-left, top-center, top-right,
center-left, center, center-right,
bottom-left, bottom-center, bottom-right
(default: bottom-right)
--opacity 0-100 Watermark opacity (default: 70)
--size N Font pts for text / logo width as % (default: 40)
-o, --output FILE
Examples:
mt image watermark photo.jpg --text "© 2026" --position bottom-right
mt image watermark photo.jpg --logo logo.png --opacity 60
mt image watermark *.jpg --text "DRAFT" --position center
stitch
🔗 mt image stitch
Stitches multiple images into a single image either vertically (stacked top-to-bottom) or horizontally (side-by-side). Images are aligned by their widths/heights respectively. Useful for creating long screenshots or comparison strips.
mt image stitch <image(s)> [options]
-m, --mode MODE vertical or horizontal (default: vertical)
-o, --output FILE Output path
Examples:
mt image stitch top.jpg bottom.jpg --mode vertical
mt image stitch left.jpg right.jpg -m horizontal -o compare.jpg
collage
🗃️ mt image collage
Creates a photo collage in grid, vertical, or horizontal layout. Images are cropped to fill uniform cells using a cover-fit algorithm (no stretching, no whitespace). Grid layout auto-calculates columns based on image count. Optional per-image rotation for artistic effect.
mt image collage <image(s)> [options]
-l, --layout LAYOUT grid, vertical, or horizontal (default: grid)
-s, --cell-size PX Cell size in pixels (default: 1024)
-r, --rotate DEG Rotate each image by DEG degrees
-o, --output FILE
Examples:
mt image collage *.jpg --layout grid
mt image collage a.jpg b.jpg c.jpg --layout horizontal
mt image collage *.jpg --cell-size 800 --rotate 5
metadata / metadata-remove
🏷️ mt image metadata
Displays all EXIF metadata embedded in an image: dimensions, format, color mode, DPI, camera make/model/lens, aperture, exposure, ISO, focal length, GPS coordinates, timestamp, artist, and copyright. Optionally saves to a .txt file.
mt image metadata <image(s)> [options]
-s, --save Save as <name>_metadata.txt beside each image
-o, --output FILE
Examples:
mt image metadata photo.jpg
mt image metadata *.jpg --save
🧽 mt image metadata-remove
Erases ALL metadata from images (EXIF, GPS, XMP, ICC profile) by re-encoding the pixel data into a clean copy. Supports JPEG, PNG, WebP, BMP, TIFF. Use --inplace to overwrite the original. Privacy-essential before sharing photos publicly.
mt image metadata-remove <image(s)> [options]
--inplace Overwrite the original file (destructive)
-o, --output FILE
Examples:
mt image metadata-remove photo.jpg
mt image metadata-remove *.jpg --inplace
bg-remove
✂️ mt image bg-remove
Removes the background from an image using the remove.bg API. Returns a transparent PNG by default. Optionally replaces the background with a solid hex color. Requires a remove.bg API key (free tier available at remove.bg).
mt image bg-remove <image> [options]
-k, --api-key KEY remove.bg API key
(or set REMOVEBG_API_KEY env var)
-c, --bg-color HEX Replace bg with color e.g. #FFFFFF
-o, --output FILE
Examples:
mt image bg-remove photo.jpg --api-key YOUR_KEY
mt image bg-remove photo.jpg -k KEY --bg-color "#FFFFFF"
histogram
📊 mt image histogram
Displays a side-by-side RGB histogram and brightness/luminance chart directly in the terminal using Unicode block characters and ANSI true-color. Shows per-channel statistics (mean, shadows %, midtones %, highlights %). Optionally saves a proper histogram image.
mt image histogram <image(s)> [options]
-s, --save Save histogram as JPEG beside source
-o, --output FILE Custom output path (--save, single file)
Examples:
mt image histogram photo.jpg
mt image histogram photo.jpg --save
dominant-color
🎨 mt image dominant-color
Extracts the top N dominant colors from an image using median-cut quantization. Displays each color as a colored ANSI block swatch in the terminal with hex value, RGB values, and percentage coverage. Optionally saves a swatch strip image.
mt image dominant-color <image(s)> [options]
-n, --count N Number of colors to extract (default: 6, max: 16)
-s, --save Save swatch strip as JPEG beside source
-o, --output FILE
Examples:
mt image dominant-color photo.jpg --count 8
mt image dominant-color photo.jpg -n 6 --save
ocr
🔍 mt image ocr
Extracts text from images or scanned PDFs using Tesseract OCR. Supports batch processing with globs. Each file's OCR result is saved to a .txt file. In batch mode use --combine to merge all results into one file. Tesseract path auto-detected per platform.
mt image ocr <file(s)> [options]
--lang LANG Tesseract language code (default: eng)
Multi-language: --lang eng+urd
Common: eng urd ara fra deu chi_sim hin
--tess-cmd PATH Override Tesseract binary path
--tessdata DIR Override tessdata directory
--combine FILE Merge all results into one .txt (batch)
-o, --output FILE Custom output (single file only)
Examples:
mt image ocr scan.png --lang eng
mt image ocr *.png --lang eng+urd --combine all_results.txt
mt image ocr scan.pdf --lang ara
duplicates
🔁 mt image duplicates
Scans a folder recursively for duplicate images. Two modes: Exact uses MD5 file hashing (byte-for-byte copies). Similar uses perceptual average-hash (aHash) with configurable Hamming distance threshold — finds near-duplicates even if re-saved, re-compressed, or slightly cropped. Optionally deletes duplicates automatically.
mt image duplicates <folder> [options]
--similar Use perceptual hash (finds near-duplicates)
--threshold N Hamming distance for --similar (default: 8,
lower = stricter match)
--delete Auto-delete all but first in each group
(DESTRUCTIVE — back up first!)
-o, --output FILE Save duplicate report as .txt
Examples:
mt image duplicates ./photos/
mt image duplicates ./photos/ --similar --threshold 5
mt image duplicates ./photos/ --similar --delete
--delete is destructive. Back up your files before using it. Always run without --delete first to review which files would be removed.
hide / reveal — Steganography
🕵️ mt image hide
Hides a secret message or text file inside an image using LSB (Least-Significant Bit) steganography on the red channel. The output image looks visually identical to the original but contains the hidden payload. Output is always PNG to prevent JPEG compression from destroying the hidden bits.
mt image hide <image> [options]
-m, --message TEXT Short text to hide
-f, --file FILE Path to .txt file to hide
-o, --output FILE Output PNG path
Examples:
mt image hide photo.jpg --message "Hello World"
mt image hide photo.jpg --file secret.txt -o hidden.png
🔓 mt image reveal
Decodes and reveals a message previously hidden with
mt image hide. Reads the LSB payload from the red channel, verifies the magic bytes, and prints the message to the terminal. Optionally saves the revealed message to a file.mt image reveal <image> [options]
-o, --output FILE Save revealed message to file
Examples:
mt image reveal hidden.png
mt image reveal hidden.png -o revealed.txt
ascii
🖥️ mt image ascii
Converts an image to ASCII art and displays it in the terminal. Supports plain ASCII and ANSI true-color mode. A compact preview is shown in the terminal while the full-resolution art is saved to file. Supports saving as a plain .txt file or a colored HTML document.
mt image ascii <image> [options]
--width COLS Full output width in characters (default: 120)
--preview-width COLS Compact terminal preview width (default: 40)
--color Use ANSI true-color (best in modern terminals)
--invert Invert brightness (for dark backgrounds)
--save-txt [FILE] Save full-res plain ASCII to .txt
--save-html [FILE] Save full-res colored HTML
Examples:
mt image ascii photo.jpg --color
mt image ascii photo.jpg --width 200 --save-html art.html
mt image ascii photo.jpg --invert --save-txt
beautify
✨ mt image beautify
Wraps a screenshot or image in a macOS-style presentation card with a gradient background, drop shadow, rounded corners, and an optional title bar with traffic-light buttons. Great for sharing code screenshots, app previews, or portfolio work on social media.
mt image beautify <image> [options]
--padding PX Inner padding around screenshot (default: 40)
--bg-color HEX Top background gradient color (default: #0F0F19)
--bg-color2 HEX Bottom background gradient color (default: #281E46)
--title TEXT Window title in the title bar
--no-titlebar Hide the macOS-style title bar
-o, --output FILE Output PNG path
Examples:
mt image beautify screenshot.png --title "My App"
mt image beautify code.png --bg-color "#0D1117" --title "editor.py"
mt image beautify photo.jpg --no-titlebar --padding 60
Color Tools — 4 commands
🎨 mt image color-mix
Blends two hex colors at a configurable ratio. Displays both input colors and the result as ANSI color swatches with hex and RGB values in the terminal. Optionally saves a swatch image.
mt image color-mix <color1> <color2> [options]
-r, --ratio 0-100 Mix ratio toward color2 (default: 50)
-s, --save Save swatch image
-o, --output FILE
Example:
mt image color-mix "#FF0000" "#0000FF" --ratio 50
🌈 mt image color-shades
Generates a range of lightness shades for a base hex color across 10 luminosity levels (80% to 0%), preserving hue and saturation. Displays each shade as a colored ANSI swatch with hex value and HSL lightness percentage.
mt image color-shades <hex-color> [options]
-s, --save Save swatch strip image
-o, --output FILE
Example:
mt image color-shades "#3B82F6"
mt image color-shades "#3B82F6" --save
🔵 mt image color-scheme
Generates a 6-color scheme from a base color: the base itself, complementary (180°), triadic (120° and 240°), and split-complementary (150° and 210°). All colors are displayed as ANSI swatches. Optionally saves a labeled swatch strip.
mt image color-scheme <hex-color> [options]
-s, --save Save swatch strip image
-o, --output FILE
Example:
mt image color-scheme "#3B82F6"
🟦 mt image color-save
Saves a solid hex color as a square JPEG image at a configurable size. Useful for generating placeholder images, color swatches, or design assets.
mt image color-save <hex-color> [options]
-s, --size PX Image size in pixels (default: 2048)
-o, --output FILE
Example:
mt image color-save "#3B82F6" --size 1024
mt image color-save "#FF6B6B" -o red_swatch.jpg
Configuration
Persistent JSON config — survives reinstalls
bash — config commands
$ mt -config show # view all settings
$ mt -config path # show config file path
$ mt -config set pdf.tesseract_cmd /path/to/tess
$ mt -config set pdf.tessdata_prefix /path/to/tessdata
$ mt -config set image.tesseract_cmd /path/to/tess
$ mt -config set image.default_quality 80
$ mt -config set global.no_color true
$ mt -config get pdf.tesseract_cmd # read a single value
$ mt -config reset # reset to defaults
| Key | Default | Description |
|---|---|---|
| pdf.tesseract_cmd | "" | Path to Tesseract binary for PDF OCR. Auto-detected if empty. |
| pdf.tessdata_prefix | "" | Path to tessdata folder for PDF OCR. Auto-detected if empty. |
| pdf.default_quality | 65 | Default JPEG quality for pdf compress command. |
| pdf.default_scale | 0.5 | Default image scale factor for pdf compress. |
| pdf.default_dpi | 150 | Default DPI for images-to-pdf command. |
| image.tesseract_cmd | "" | Path to Tesseract binary for image OCR. Auto-detected if empty. |
| image.tessdata_prefix | "" | Path to tessdata folder for image OCR. |
| image.default_quality | 75 | Default JPEG quality for image compress. |
| image.default_format | JPEG | Default output format for image compress. |
| global.no_color | false | Disable ANSI colors in terminal output. |
| global.verbose | false | Enable verbose logging output. |
Config file locations
| Platform | Path |
|---|---|
| Pydroid 3 | /sdcard/mt/config.json |
| Termux | /sdcard/mt/config.json |
| Linux / macOS | ~/.mt/config.json |
| Windows | C:\Users\<you>\.mt\config.json |
Python API
Use multi_tools as a library in your own Python scripts
python
from multi_tools import pdf
from multi_tools import image
# ── PDF functions ─────────────────────────────────────────────
pdf.compress("in.pdf", "out.pdf", quality=55, scale=0.6)
pdf.merge(["a.pdf", "b.pdf"], "combined.pdf")
pdf.split("doc.pdf", "1-3,5", "out.pdf")
pdf.rotate("doc.pdf", 90, "out.pdf")
pdf.watermark("doc.pdf", "CONFIDENTIAL", "out.pdf")
pdf.encrypt("doc.pdf", "password", "out.pdf")
pdf.repair("broken.pdf", "fixed.pdf")
pdf.redact("doc.pdf", ["SSN", "password"], "clean.pdf")
sections = pdf.info("report.pdf") # returns dict
pdf.extract_text("doc.pdf", "out.txt")
pdf.ocr("scan.pdf", "out.txt", lang="eng")
pdf.pdf_to_md("report.pdf", "report.md")
pdf.remove_blank_pages("scan.pdf", "clean.pdf", text_threshold=10)
pdf.extract_images("doc.pdf", "images.zip", min_width=300)
pdf.images_to_pdf(["a.jpg", "b.png"], "album.pdf", page_size="a4")
pdf.add_page_numbers("doc.pdf", "numbered.pdf", position="bottom-center")
pdf.add_header_footer("doc.pdf", "out.pdf",
header="My Corp", footer="Page {page} of {total}")
pdf.extract_tables("data.pdf", "./tables/")
pdf.pdf_to_images_embedded("scan.pdf", "./pages/", fmt="jpg")
# ── Image commands ────────────────────────────────────────────
image.main(["compress", "photo.jpg", "-q", "80", "-f", "WEBP"])
image.main(["resize", "photo.jpg", "--width", "800"])
image.main(["thumbnail", "photo.jpg", "--sizes", "128,256,512"])
image.main(["watermark", "photo.jpg", "--text", "© 2026"])
image.main(["collage", "a.jpg", "b.jpg", "--layout", "grid"])
image.main(["ocr", "scan.png", "--lang", "eng"])
image.main(["dominant-color", "photo.jpg", "--count", "8"])
image.main(["beautify", "screenshot.png", "--title", "My App"])
image.main(["ascii", "photo.jpg", "--color"])
image.main(["hide", "photo.jpg", "--message", "Secret"])
image.main(["reveal", "hidden.png"])
image.main(["duplicates", "./photos/", "--similar"])
image.main(["color-scheme", "#3B82F6"])