[C++ Project] Image compression algorithm called CVD-BitMatrix – technical notices

Hello,

I’m currently working on an image compression algorithm in C++ based on a matrix approach.

The goal is to reduce the file size while preserving the visual structure.

I would be interested in your technical feedback, particularly on:

  • the suitability of the approach
  • possible improvements
  • potential limitations

Details + code:

link github

(https://discussions.unity.com/:https://mohamedtrigui5.blogspot.com/...age-de-13.html)

("Comment j'ai compressé une image de 13 Mo en seulement "~10-12 Ko". : L'algorithme CVD-BitMatrix™.")[image]

Thank you in advance for your feedback.

1 Like

wow, can you still do the quadtree kind of optimization, like do 1 bit for 4 pixels, or 1 bit for 8 pixel or 16 etc

1 Like

also by splitting images up with quadtree, you can reduce number of bits per channel and quantize colors better and cluster it begore the bit plane is generated.
also how does it parallel on gpu, do you have any kernels for the generation or entropy coding?

1 Like

Hi eeeeeeeeeeeeee,

Thank you for this very insightful feedback!

You are absolutely right. Integrating a Quadtree-based optimization is indeed one of the next steps for the CVD-BitMatrix™ evolution.

“The idea would be to use Quadtree to generate a hierarchical bit stream, drastically reducing the cost of ‘bit silence’ areas (areas where a specific color is not present).”

Regarding your suggestions:

  1. 1 bit for 4/8/16 pixels: Currently, my algorithm uses a 1:1 mapping (1 bit per pixel) within the bit-plane. However, implementing a hierarchical decomposition (Quadtree) would allow to encode large uniform areas with a single bit or a small code, drastically reducing the entropy of the bit-stream, especially for UI assets or flat-design textures.
  2. Pre-generation Quantization: I am currently working on improving the color grouping (quantization) before the bit-plane generation. Using a Quadtree to analyze spatial redundancy before creating the layers would definitely help in better clustering the “Color-Vect-Decimal” streams and reducing the overall metadata.

Current focus:
At this stage, I focused on the core stability of the Bit-Plane Layered Sequencing to reach the 1000:1 ratio on high-res AI images. But adding a Quadtree structure for spatial optimization will definitely be a game-changer for real-time rendering in Unity.

I’d be happy to discuss this further if you have specific implementation ideas regarding GPU-side decoding for these Quadtree structures!

Best regards,
Mohamed Trigui

Hi eeeeeeeeeeeeee,

After deep technical reflection and further benchmarking, I’ve decided not to integrate Quadtree optimization into the current architecture of CVD-BitMatrix™, neither as a secondary compression layer nor as a replacement for the current bit-plane sequencing.

Here is the rationale behind this decision:

  1. Prioritizing Real-Time Performance: My primary goal for this technology is its integration into real-time environments, such as game engines and high-speed asset streaming. While Quadtrees can reduce file size, they significantly increase algorithmic complexity. The recursive nature of tree traversal introduces CPU overhead that breaks the linear “Bit-Stream” flow, leading to slower decoding times.
  2. The Size-to-Speed Balance: The current v1.0 of CVD-BitMatrix™ already achieves a record-breaking 1084:1 ratio (13MB to 12KB) while maintaining near-instantaneous decompression. Adding a Quadtree layer might save a few extra KBs, but at the cost of losing the “instant-load” experience which is vital for modern game development.
  3. Strategic Roadmap:
    Rather than making the core algorithm heavier, I am officially branching the project into three specialized directions to maximize performance for each use case:
  • :rocket: CVD-BitMatrix CPU-Turbo: Max-optimized for desktop processors using advanced Multi-threading (OpenMP) and SIMD instructions for ultra-fast archival and transfer.
  • :video_game: CVD-BitMatrix GPU: A specialized port using Compute Shaders (Vulkan/VDI/CUDA) for real-time texture decompression directly in VRAM, eliminating CPU bottlenecks.
  • :joystick: CVD-BitMatrix Retro: A lightweight version adapted for legacy 8/16-bit systems (NES/SNES), focusing on low-cycle complexity to maximize storage on limited hardware.

I believe this “Balanced-Linear” approach is the most viable for professional production pipelines. You can find the updated Research Roadmap and the new documentation on the official repository.

Official Repository: link github

Best regards,
Mohamed Trigui
Computer Science Researcher | CVD-BitMatrix™ Creator

Title: [CRITICAL UPDATE] Major Fix for CVD-BitMatrix (v2.0)
Hello everyone,

I would like to inform you that a major bug fix update has just been deployed to the CVD-BitMatrix repository.

I recently discovered a critical error in the loading and decoding functions for .cvd1 and .cvd2 files. This bug caused the program to crash immediately when opening an image. I sincerely apologize for this inconvenience if you have tried to use the tool in the last few days.

The problem has been completely resolved. The current version (v2.0) is now stable and fully functional.

Here are the details of the fixes (Changelog):

Restored Load/Save consistency: Fixed an alignment error in FileCVD. The bitstream read pointer is now perfectly synchronized with the write operation, ensuring that each data segment is assigned to the correct color layer.

Renderer Engine Optimization (Software): Removed computational redundancy in the decoder. Instead of iterating through the entire image resolution, the engine now only processes active memory segments.

Island Skipping Algorithm: Improved selective read logic. The decoder instantly identifies and ignores null pixel sequences at the byte level, eliminating unnecessary CPU load on uncolored areas.

Crash Fix: Resolved an invalid memory access that caused the program to close abruptly.

The source code (Encoder.cpp, FileCVD.cpp) and the release executables have been updated on GitHub.

Project link: GitHub - mohamedtrigui5-lab/CVD-BitMatrix: CVD-BitMatrix™: High-performance Bit-Plane image compression algorithm (Ratio > 1000:1) · GitHub

Thank you for your patience and support. I’m now returning to the development of the Turbo CPU and GPU branches!

Project status: Development stopped (see details below and readme github link)

Hello everyone,

After several weeks of intensive research, testing, and iterations on CVD-BitMatrix, I would like to share an important update regarding the project.

During the initial release, some results were based on incorrect calculations and incomplete validation. These issues have since been carefully reviewed and analyzed.

Following deeper investigation, it appears that the performance levels initially observed cannot be reliably reproduced with the current approach. Further development has led to significantly different results, highlighting fundamental limitations in the current model.

As a result, I have decided to stop active development of this version of the project.

That said, this work remains a valuable research exploration into unconventional image compression techniques. It helped uncover important insights regarding matrix-based representations and their practical limits.

The repository will remain available for transparency and learning purposes.

I would like to thank everyone who provided feedback and support.

— Mohamed Trigui