From a08a113080a4810d87b9834212d47b9c0fea0bfe Mon Sep 17 00:00:00 2001 From: Miller Cy Chan Date: Wed, 6 Nov 2024 07:40:36 +0800 Subject: [PATCH] Update README.md --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 9864e25..a9e06f5 100644 --- a/README.md +++ b/README.md @@ -9,26 +9,26 @@ Only png can support semi transparent image and desired color depth. Gif can ens 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

+

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 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

+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

+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. @@ -42,9 +42,9 @@ The top 3 color quantization algorithms for 32 colors or less are:
  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`.
+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 /a pnnlab`.
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. +nQuantCpp will quantize yourImage.jpg with maximum colors 16, algorithm pnnlab 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.