https://github.com/artstyle19/quadtree-image-compression
Interactive image compression viewer built with C++ / OpenGL. Uses a quadtree to split images into blocks: big for smooth regions, small for details.
https://github.com/artstyle19/quadtree-image-compression
cpp17 image-compression image-processing opengl quadtree quadtree-art quadtrees
Last synced: about 1 month ago
JSON representation
Interactive image compression viewer built with C++ / OpenGL. Uses a quadtree to split images into blocks: big for smooth regions, small for details.
- Host: GitHub
- URL: https://github.com/artstyle19/quadtree-image-compression
- Owner: ArtStyle19
- License: mit
- Created: 2025-09-06T13:54:30.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-09-06T14:29:47.000Z (10 months ago)
- Last Synced: 2025-09-06T16:08:15.164Z (10 months ago)
- Topics: cpp17, image-compression, image-processing, opengl, quadtree, quadtree-art, quadtrees
- Language: C++
- Homepage:
- Size: 6.07 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🌀 Quadtree Image Compression
---
## Developed by
## Jorge Guillermo Olarte Quispe
---
## Universidad Nacional del Altiplano – IngenierÃa de Sistemas
---
A fast and interactive C++ / OpenGL tool to explore image compression with quadtrees.
The algorithm adaptively divides the image: big squares in uniform areas, tiny squares where details matter.
You can adjust parameters live, zoom and pan the canvas, customize colors, and export your compressed image as a PNG.
## Screenshots
| Quadtree Grid | Grid (Tinted) | Compressed Images |
| ----------------------------------- | ----------------------------------------- | ---------------------------------------- |
|  |  |  |
|  |  |  |
|  |  |  |
|  |  |  |
> Screenshot UI:
> 
## Features
- Quadtree segmentation of images
- Adjustable leaf size and standard deviation threshold
- Zoom & pan the canvas
- Customizable grid color, line width, and background color
- Load images via drag-and-drop or file browser
- Save compressed images to PNG
## Build & Run
### Requirements
- C++17 compiler
- CMake ≥ 3.15
- OpenGL (fixed-function is fine)
- GLFW3
- (Linux) X11 + pthread + dl
- Vendored: Dear ImGui, stb, ImGuiFileDialog (already in `include/`)
### Linux / macOS
## Using cmake
```bash
git clone https://github.com/ArtStyle19/quadtree-image-compression.git
cd quadtree-image-compression
rm -rf build
cmake -S . -B build
cmake --build build -j
# run
./build/bin/quadtree_viewer images/image.png
```
## Using g++
```bash
g++ -std=c++17 src/main3.cpp \
include/imgui/imgui.cpp include/imgui/imgui_draw.cpp include/imgui/imgui_widgets.cpp include/imgui/imgui_tables.cpp \
include/imgui/backends/imgui_impl_glfw.cpp include/imgui/backends/imgui_impl_opengl2.cpp \
-Iinclude -Iinclude/imgui -Iinclude/imgui/backends \
-lglfw -lGL -ldl -lpthread -lX11 -lXrandr -lXi -lXxf86vm -lXcursor \
-o quadtree_viewer
./quadtree_viewer
```
## Controls
- **Mouse wheel**: zoom in/out (anchored at cursor)
- **Drag (LMB/RMB)**: pan
- **Double-click (LMB)**: reset view
- **GUI (left panel)**:
- _Leaf power_ (`2^k`) and _StdDev power_ (`2^k`)
- Toggle **Fill** / **Grid**
- **Grid color** picker + **line width**
- **Canvas background** color picker
- **Browse…** to load image; **Save PNG** to export