Skip to main content

Image Processing

Split grid images, remove backgrounds, enhance image quality, and convert images to WebP. AI-powered tools require a fal.ai API key (prompted on first use); the WebP converter runs entirely locally.

image-split

Splits a grid image into individual tiles.

kappmaker image-split grid.png --rows 4 --cols 4 --zoom 1.1 --gap 3
kappmaker image-split grid.png --keep 1,5 # Keep only tiles 1 and 5

Options

FlagDescriptionDefault
--rows <n>Number of rows4
--cols <n>Number of columns4
--zoom <factor>Zoom factor to crop edges1.07
--gap <pixels>Gap pixels at each tile edge0
--width <pixels>Output tile width512
--height <pixels>Output tile height512
--output-dir <path>Directory to save tiles.
--keep <indices>Comma-separated tile indices to keepAll

image-remove-bg

Removes background using fal.ai bria model. Outputs PNG with transparency.

kappmaker image-remove-bg logo.png
kappmaker image-remove-bg photo.jpg --output clean.png

Options

FlagDescriptionDefault
--output <path>Custom output path<filename>_no_bg.png

image-enhance

Upscales and improves image quality using fal.ai nano-banana-2 edit model.

kappmaker image-enhance logo.png
kappmaker image-enhance photo.jpg --output improved.png

Options

FlagDescriptionDefault
--output <path>Custom output path<filename>_enhanced.png

convert-webp

Converts images (PNG, JPG, JPEG, BMP, TIFF, GIF) to WebP format — similar to Android Studio's built-in converter. Runs entirely locally using sharp, no API key needed.

kappmaker convert-webp icon.png # Single file
kappmaker convert-webp app/src/main/res/drawable --recursive # Entire directory tree
kappmaker convert-webp assets/ --quality 90 --recursive # Custom quality
kappmaker convert-webp assets/ --recursive --delete-originals # Remove originals after conversion
kappmaker convert-webp assets/ --output converted/ # Output to a different directory

Shows before/after file sizes and percentage saved for each file, with a total at the end.

Options

FlagDescriptionDefault
--quality <n>WebP quality (0–100)75
--recursiveSearch directories recursivelyfalse
--delete-originalsDelete original files after conversionfalse
--output <dir>Output directory (default: same as source)