This repository contains an image compression application that leverages a Quadtree data structure, built in
C++ using OpenCV and ImageMagick that implements various Divide and Conquer and Decrease and Conquer algorithms. This program also incorporates multiple error measurement methodsβincluding variance, mean absolute deviation (MAD), maximum pixel difference, entropy, and Structural Similarity Index (SSIM)βto decide when to subdivide image regions. Additionally, it can generate Graphics Interchange Format (GIF) files to visualize the compression process, providing an intuitive demonstration of how the quadtree structure evolves during compression. - Git
- Any IDE (recommended: VSCode)
- Chocolatey (for Windows)
- CMake
- OpenCV
- ImageMagick
- FFmpeg
- C++ Compiler
- Git
https://git-scm.com/download/win
- VSCode
winget install microsoft.visualstudiocode
- Mingw (C++ Compiler)
# Install and setup for Windows (see the docs below) https://www.mingw-w64.org/downloads/ - Chocolatey (Package installer for Windows)
# Install and setup (see the docs below) https://chocolatey.org/install - Dependecies
# Run it in administrator mode (cmd/powershell) choco install cmake -y choco install opencv -y choco install imagemagick -y
- Git
sudo apt-get install git
- VSCode
sudo apt install software-properties-common apt-transport-https wget wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" sudo apt update sudo apt install code
- Mingw (C++ Compiler)
# Install and setup for your Linux distro (see the docs below) https://www.mingw-w64.org/downloads/ - Dependecies
sudo apt update sudo apt install cmake sudo apt install libopencv-dev sudo apt install imagemagick sudo apt install ffmpeg
- Open a terminal
- Clone the repository (if not already cloned)
git clone https://github.com/Nayekah/Tucil2_13523027_13523090.git
- Make Tucil2_13523027_13523090 as root directory:
cd .\Tucil2_13523027_13523090
- Install the dependencies first (if not already installed)
- Do:
build.bat # or .\build.bat
- Open a terminal
- Clone the repository (if not already cloned)
git clone https://github.com/Nayekah/Tucil2_13523027_13523090.git
- Make Tucil2_13523027_13523090 as root directory:
cd .\Tucil2_13523027_13523090
- Do:
clean.bat # or .\clean.bat
- Open a terminal
- Clone the repository (if not already cloned)
git clone https://github.com/Nayekah/Tucil2_13523027_13523090.git
- Make Tucil2_13523027_13523090 as root directory:
cd Tucil2_13523027_13523090/ - Install the dependencies first (if not already installed)
- Do:
./build.sh
- Open a terminal
- Clone the repository (if not already cloned)
git clone https://github.com/Nayekah/Tucil2_13523027_13523090.git
- Make Tucil2_13523027_13523090 as root directory:
cd Tucil2_13523027_13523090/ - Do:
./clean.sh
- Open a terminal
- Clone the repository (if not already cloned)
git clone https://github.com/Nayekah/Tucil2_13523027_13523090.git
- Make Tucil2_13523027_13523090 as root directory:
cd Tucil2_13523027_13523090/ - Install the dependencies first (if not already installed)
- Do:
./run.sh basic
- Open a terminal
- Clone the repository (if not already cloned)
git clone https://github.com/Nayekah/Tucil2_13523027_13523090.git
- Make Tucil2_13523027_13523090 as root directory:
cd Tucil2_13523027_13523090/ - Install the dependencies first (if not already installed)
- Do:
./run.sh page
- Open a terminal
- Clone the repository (if not already cloned)
git clone https://github.com/Nayekah/Tucil2_13523027_13523090.git
- Make Tucil2_13523027_13523090 as root directory:
cd .\Tucil2_13523027_13523090
- Install the dependencies first (if not already installed)
- Do:
run.bat basic or .\run.bat basic
- Open a terminal
- Clone the repository (if not already cloned)
git clone https://github.com/Nayekah/Tucil2_13523027_13523090.git
- Make Tucil2_13523027_13523090 as root directory:
cd .\Tucil2_13523027_13523090
- Install the dependencies first (if not already installed)
- Do:
run.bat page or .\run.bat page
if you encounter error when running in windows (or the binary can't be run), go to the run.bat:
# Set OpenCV path based on your device's path (change this line in run.bat)
if exist "C:\tools\opencv\build"
# Set ImageMagick path based on your device's path (change this line in run.bat)
if exist "C:\Program Files\ImageMagick*"
```
π Tucil2_13523027_13523090/
βββ π bin/
β βββ .gitignore
β βββ quadtree_compression
β βββ quadtree_compression.exe
β
βββ π doc/
β βββ .gitkeep
β βββ Tucil2_13523027_13523090.pdf
β
βββ π src/
β βββ π comps/
β β βββ BasicInputManager.cpp
β β βββ CompressionAnalyzer.cpp
β β βββ ErrorCalculation.cpp
β β βββ GifGenerator.cpp
β β βββ ImageProcessor.cpp
β β βββ InputManager.cpp
β β βββ QuadTree.cpp
β β βββ main.cpp
β β
β βββ π header/
β β βββ BasicInputManager.hpp
β β βββ CompressionAnalyzer.hpp
β β βββ CompressionParams.hpp
β β βββ ErrorCalculator.hpp
β β βββ GifGenerator.hpp
β β βββ ImageProcessor.hpp
β β βββ InputManager.hpp
β β βββ Pixel.hpp
β β βββ QuadTree.hpp
β β
β βββ .gitkeep
β
βββ π test/
β βββ π input/
β β βββ W.jpg
β β βββ bocchi.jpg
β β βββ coffee.jpg
β β βββ flower.jpg
β β βββ isagi.jpg
β β βββ kaneki.jpeg
β β βββ kosong.png
β β βββ lappland.jpg
β β βββ misteri.jpg
β β βββ sample1.jpg
β β βββ texas.jpg
β β βββ tragedy.png
β β
β βββ π output/
β β βββ W256.jpg
β β βββ W256gif.gif
β β βββ W64.jpg
β β βββ W64gif.gif
β β βββ Wlow.jpg
β β βββ Wlowgif.gif
β β βββ bocchlow.jpg
β β βββ bocchlowgif.gif
β β βββ flower.gif
β β βββ lappgif.gif
β β βββ lapplow.jpg
β β βββ mygoat.jpg
β β βββ mygoat2.jpg
β β βββ rcoffee.jpg
β β βββ rkaneki.jpeg
β β βββ rtragedy.png
β β βββ sample1a.jpg
β β βββ texlow2.jpg
βββ CMakeLists.txt
βββ README.md
βββ build.bat
βββ build.sh
βββ clean.bat
βββ clean.sh
βββ run.bat
βββ run.sh
| No | Points | Yes | No |
|---|---|---|---|
| 1 | The program compiles successfully without errors. | βοΈ | |
| 2 | The Program successfully executed. | βοΈ | |
| 3 | The program successfully compresses the image according to the specified parameters. | βοΈ | |
| 4 | Implement all mandatory error calculation methods. | βοΈ | |
| 5 | [Bonus] Implementation of compression percentage as an additional parameter. | βοΈ | |
| 6 | [Bonus] Implementation of Structural Similarity Index (SSIM) as an error measurement method. | βοΈ | |
| 7 | [Bonus] Output as GIF Visualizing the Process of Quadtree formation in Image Compression. | βοΈ | |
| 8 | Program and report made by ourself | βοΈ |
Project Black Lock β’ Β© 2025 β’ 13523027-13523090
