Color Reducer Library
Welcome to the Color Reducer library! This Rust crate provides functionality to simplify images by reducing the number of colors based on a predefined palette. It is particularly useful for image processing tasks where color quantization and noise reduction are required.
Overview
The Color Reducer library allows you to reduce the number of colors in an image by mapping each pixel to the closest color in a predefined palette. Additionally, it offers functionality to merge small regions (considered as noise) into larger ones based on an area threshold, enhancing image quality by removing insignificant details.
Features
- Color Reduction: Simplify images by reducing colors to a predefined palette.
- Noise Reduction: Merge small regions based on area threshold to eliminate noise.
Installation
Add this crate to your project:
Then, run cargo build to fetch the library.
Usage
Basic Example
Here's a simple example of how to use the Color Reducer library to process an image:
use DynamicImage;
use ColorReducer;
Show case
Use following white-to-black 16 color palette
let palette = vec!;
you will get

Performance
- Parallel Processing: The library uses Rust's concurrency features to process the color reduction step efficiently.
- Optimized Algorithms: Algorithms are designed to be performant while maintaining code readability and reliability.
License
This project is licensed under the MIT License and APACHE License. See the LICENSE file for details.
Thank you for choosing the Color Reducer library! We hope it meets your image processing needs. If you encounter any issues or have any questions, please feel free to reach out via the issue tracker on GitHub.