top | item 18675526

(no title)

dfbrown | 7 years ago

I'm not an expert in the topic, but my understanding is RGB is a poor color space for computing color difference. This could be why your mosaics end up so washed out. [1] suggests using a CIELAB color space [2].

Edit: Looking at the code more closely it looks like you were using Lab at one point but commented it out[3], so I'm guessing you're already aware of this.

1: https://stackoverflow.com/a/9019461/185171

2: https://en.wikipedia.org/wiki/CIELAB_color_space#CIELAB

3: https://github.com/worldveil/photomosaic/blob/bb720efda11383...

discuss

order

muzakthings|7 years ago

It didn’t make a ton of difference empirically when I tried it.

But you’re correct, generally that’s the space you want to be in.

gedy|7 years ago

It is quite noticeable when you are using a limited selection of tiles or image has desaturated colors.

I've done some similar work[1], but issue with L*ab color is it's terrifically slow to calculate diff, at least in JS.

[1] https://imgur.com/a/g3EzcSV

itronitron|7 years ago

there is no perfect way to measure color distances, mostly because it needs to account for human perception of color and there are individual differences in color perception among people.