All Projects → mcychan → nQuantCpp

mcychan / nQuantCpp

Licence: GPL-3.0 license
nQuantCpp includes top 6 color quantization algorithms for visual c++ producing high quality optimized images.

Programming Languages

C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to nQuantCpp

MultiTileBlueNoise
Storage for blue noise textures, including mixed-tiling textures, in results/
Stars: ✭ 16 (-80.72%)
Mutual labels:  dithering, blue-noise
hicolor
🎨 Convert images to 15/16-bit RGB color with dithering
Stars: ✭ 172 (+107.23%)
Mutual labels:  dithering, color-quantization
colorquant
Go library for color quantization and dithering
Stars: ✭ 75 (-9.64%)
Mutual labels:  dithering, color-quantization
Jpeek
Java Code Static Metrics (Cohesion, Coupling, etc.)
Stars: ✭ 168 (+102.41%)
Mutual labels:  quality
Vividus
Vividus is all in one test automation tool
Stars: ✭ 170 (+104.82%)
Mutual labels:  quality
openpolice
OpenPolice empowers people to prepare, file, and track police misconduct complaints. By allowing users to publish reports online, we aim to establish an independent and transparent repository of police activity in the U.S.
Stars: ✭ 24 (-71.08%)
Mutual labels:  transparency
performance testing
Tools, articles, etc. related to performance/load/etc. testing.
Stars: ✭ 172 (+107.23%)
Mutual labels:  quality
Eslint Plugin Boundaries
Eslint plugin checking architecture boundaries between elements
Stars: ✭ 157 (+89.16%)
Mutual labels:  quality
video-quality-metrics
Test specified presets/CRF values for the x264 or x265 encoder. Compares VMAF/SSIM/PSNR numerically & via graphs.
Stars: ✭ 87 (+4.82%)
Mutual labels:  quality
introduction-nodejs
Introduction to NodeJS
Stars: ✭ 13 (-84.34%)
Mutual labels:  quality
Qulice
Quality Police for Java projects
Stars: ✭ 250 (+201.2%)
Mutual labels:  quality
Phpmetrics
Beautiful and understandable static analysis tool for PHP
Stars: ✭ 2,180 (+2526.51%)
Mutual labels:  quality
php-best-practices
What I consider the best practices for web and software development.
Stars: ✭ 60 (-27.71%)
Mutual labels:  quality
Jscpd
Copy/paste detector for programming source code.
Stars: ✭ 2,397 (+2787.95%)
Mutual labels:  quality
recursion-and-dynamic-programming
Julia and Python recursion algorithm, fractal geometry and dynamic programming applications including Edit Distance, Knapsack (Multiple Choice), Stock Trading, Pythagorean Tree, Koch Snowflake, Jerusalem Cross, Sierpiński Carpet, Hilbert Curve, Pascal Triangle, Prime Factorization, Palindrome, Egg Drop, Coin Change, Hanoi Tower, Cantor Set, Fibo…
Stars: ✭ 37 (-55.42%)
Mutual labels:  hilbert-curve
Coveragechecker
Allows old code to use new standards
Stars: ✭ 159 (+91.57%)
Mutual labels:  quality
javascript-test-reporter
DEPRECATED Code Climate test reporter client for JavaScript projects
Stars: ✭ 68 (-18.07%)
Mutual labels:  quality
Faceimagequality
Code and information for face image quality assessment with SER-FIQ
Stars: ✭ 223 (+168.67%)
Mutual labels:  quality
Codeclimate
Code Climate CLI
Stars: ✭ 2,273 (+2638.55%)
Mutual labels:  quality
fabrica-collaborative-editing
Plugin to make WordPress more Wiki-like by allowing more than one person to edit the same Post, Page, or Custom Post Type at the same time. When there are conflicting edits, it helps users to view, compare, and merge changes before saving.
Stars: ✭ 19 (-77.11%)
Mutual labels:  transparency

nQuantCpp

nQuantCpp includes top 6 color quantization algorithms for visual c++ producing high quality optimized images. I enhance each of the algorithms to support semi transparent images. nQuantCpp also provides a command line wrapper in case you want to use it from the command line.

Either download nQuantCpp from this site or add it to your Visual Studio project seamlessly. PNG is useful because it's the only widely supported format which can store partially transparent images. The format uses compression, but the files can still be large. Use Color quantization algorithms can be chosen by command line since version 1.10 using the /a algorithm. Only png can support semi transparent image and desired color depth. Gif can ensure the number of colors for the converted image is 256 or less. Bmp does support desired color depth. Jpg only supports 24-bit image format.

Let's climb up the mountain: Ready, Go!!!

Original photo of climbing

Reduced to 256 colors by Divisive hierarchical clustering algorithm

Reduced to 256 colors by NeuQuant Neural-Net Quantization Algorithm

Reduced to 16 colors by Fast pairwise nearest neighbor based algorithm

Reduced to 16 colors by Fast pairwise nearest neighbor based algorithm with CIELAB color space

Reduced to 16 colors by Xialoin Wu's fast optimal color Quantization Algorithm


Original photo of Aetna's Hartford headquarters

Reduced to 256 colors by NeuQuant Neural-Net Quantization Algorithm

Reduced to 256 colors by Fast pairwise nearest neighbor based algorithm


Original image of Hong Kong Cuisines

Fast pairwise nearest neighbor based algorithm with CIELAB color space in 16 colors
High quality and fast

Fast pairwise nearest neighbor based algorithm with CIELAB color space with CIELAB color space in 16 colors

Efficient, Edge-Aware, Combined Color Quantization and Dithering with CIELAB color space in 16 colors
Higher quality for 32 or less colors but slower
Efficient, Edge-Aware, Combined Color Quantization and Dithering with CIELAB color space in 16 colors

Spatial color quantization with CIELAB color space in 16 colors
Higher quality for 32 or less colors but the slowest
Spatial color quantization with CIELAB color space in 16 colors

All in all, the top 3 color quantization algorithms for 256 colors are:
  1. Fast pairwise nearest neighbor based algorithm
  2. Xialoin Wu's fast optimal color quantizer
  3. NeuQuant Neural-Net Quantization Algorithm with CIELAB color space
The top 3 color quantization algorithms for 32 colors or less are:
  1. Fast pairwise nearest neighbor based algorithm with CIELAB color space advanced version
  2. Efficient, Edge-Aware, Combined Color Quantization and Dithering algorithm with CIELAB color space
  3. Spatial color quantization algorithm with CIELAB color space

If you are using the command line. Assuming you are in the same directory as nQuantCpp.exe, you would enter: nQuantCpp yourImage.jpg /m 16.
To avoid dot gain, /d n can set the dithering to false. However, false contours will be resulted for gradient color zones.
nQuantCpp will quantize yourImage.jpg and create yourImage-PNNLABquant16.png in the same directory.

The readers can see coding of the error diffusion and dithering are quite similar among the above quantization algorithms. Each algorithm has its own advantages. I share the source of color quantization to invite further discussion and improvements. Such source code are written in C++ to gain best performance. It is readable and convertible to c#, java, or javascript. Welcome for C++ experts for further improvement or provide color quantization algorithms better than the above algorithms. Please use issues to track ideas, enhancements, tasks, or bugs for work on GitHub.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].