okaneco / rscolorq

Spatial color quantization in Rust
Apache License 2.0
61 stars 2 forks source link

Bias towards the color black. #15

Open tunaflsh opened 10 months ago

tunaflsh commented 10 months ago

I'm trying to quantize this image. But it is biased towards darker colors, which are less appealing the the brighter colors. And it would make more sense to have more brighter colors in the limited palette. Do you have any idea if I'm setting this incorrectly? image

  1. Run
rscolorq -i image.png -o image-32-lab.png --op image-32pal-lab.png -n 32 --lab -p --auto -s 0
  1. Results
13191b,000b08,000000,70493f,000000,3d2c20,b1a9c6,434348,2d1c23,1c1011,957384,32292b,1e2d33,231e1b,282924,282428,ae5670,67475c,33302e,44323c,485974,9c3041,fdf0ea,000505,0f0409,3e1920,528dd3,000100,656256,303e7e,f396a1,1c2141

image-32pal-lab image-32-lab

And it's way worse without the --lab color space

  1. Run
rscolorq -i image.png -o image-32.png --op image-32pal.png -n 32 -p --auto -s 0
  1. Results
000000,000000,000000,fce8e5,000000,000000,313a76,dc6676,000000,000000,000000,000000,000000,000000,422023,487fc8,000000,000000,000000,90526d,000000,5b5551,000000,37525f,000000,000000,000000,1a1f3c,000000,000000,000000,8f2c38

image-32pal image-32

Isn't it supposed to generate 32 distinct colors? Instead the color black is repeated multiple times.