A high-performance image processing tool that simplifies images using adaptive quad-tree partitioning with variance-based splitting.
This is a Rust command-line tool that transforms images into a simplified representation by:
- Dividing the image into rectangular regions of varying sizes
- Using more detail (smaller rectangles) where the image is complex
- Using less detail (larger rectangles) where the image is simple
The program analyzes your image and creates a quad-tree structure:
- Starts with the whole image as one rectangle
- Finds the region with the most color variation (faces, edges, text, patterns)
- Splits that region into 4 quadrants (northwest, northeast, southwest, southeast)
- Repeats for N iterations
- Fills each final region with its average color
1000000 iterations
50000 iterations
25000 iterations
10000 iterations
1000 iterations
- Rust (version 1.70 or later)
cd qtree
cargo build --releasecargo run --release -- <input-image> -iter <iterations> [options]<input-image>- Path to your input image (supports .jpg, .png, .gif, etc.)-iter <N>- Number of subdivisions to perform-o <path>- Output file path (default:input-compressed.extin current directory)-outline <hex>- Add colored borders around regions (e.g.,000000for black,FF0000for red)-gif <interval>- Create animated GIF showing the algorithm's progress, saving every N iterations-outline HEXCOLOR- Draw borders around each region, making the quad-tree structure visible.
All dependencies are automatically downloaded by Cargo.









