https://github.com/nilssonk/ordered-dithering-cpp
A tool for performing black and white Bayer dithering, written in C++17.
https://github.com/nilssonk/ordered-dithering-cpp
bayer cpp cpp17 dithering
Last synced: 9 months ago
JSON representation
A tool for performing black and white Bayer dithering, written in C++17.
- Host: GitHub
- URL: https://github.com/nilssonk/ordered-dithering-cpp
- Owner: nilssonk
- License: gpl-3.0
- Created: 2021-10-21T07:33:58.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-11-03T23:05:36.000Z (over 3 years ago)
- Last Synced: 2025-06-07T10:47:36.626Z (10 months ago)
- Topics: bayer, cpp, cpp17, dithering
- Language: C++
- Homepage:
- Size: 477 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ordered-dithering-cpp
A tool for performing black and white Bayer dithering, written in C++17.


### 2x2 Bayer Kernel

### 4x4 Bayer Kernel

### 8x8 Bayer Kernel

## Usage
```
# Use the 8x8 Bayer kernel (currently available sizes are 2x2, 4x4, and 8x8).
# Increase pre-dithering brightness by 30 (pixel intensity values range from 0-255).
# Increase pre-dithering contrast by 15%.
# For the PNG output format, a bit depth of 1 is automatically selected.
ordered_dithering_main /path/to/some_image.jpg /path/to/output.png 8 30 1.15
```
## Dependencies
There are a few dependencies required to build this tool:
#### Bundled/Fetched by CMake
- ASIO (https://think-async.com/Asio)
- fmt (https://github.com/fmtlib/fmt)
#### Not included
- libvips (https://github.com/libvips/libvips)
## Building
The recommended way of building this project is as follows:
1. Grab the source code
```
git clone https://github.com/nilssonk/ordered-dithering-cpp
cd ordered-dithering-cpp
```
2. Run CMake to configure and build the project using presets and ninja-build
```
# Clang Debug build with clang-tidy static analysis enabled
cmake --preset=clang-debug .
cmake --build --preset=clang-debug
# GCC Release build with LTO enabled
cmake --preset=gcc-release-lto .
cmake --build --preset=gcc-release-lto
```
If all goes well, the executable can then be found at _main/ordered_dithering_main_ inside the build directory (default _${sourceDir}/build_).