Bring the lights up!
Finally, I've improved Heckbert's median-cut color quantizer to pay respect
(press X if you do so) to all the highlights in your scene!
I've fully rewritten his standard algorithm (see paper referred last time). My
new version is now able to allow different strategies which can be switched /
modified at runtime, while the algorithm computes the optimal colors,
regarding how and which the next color cube should be chosen and how it should
be split. Different metrics can be used to get the next cube for further
investigation. One strategies I've now implemented is for the highlights in
the scene, which requires to change the selection process of the next cube and
also how it should be split compared to the standard median-cut procedure.
So, finally, I can adjust for the highlights in an image, not in a fixed way,
but in discrete steps by simply varying a parameter. Hence, one can put as
much focus on the highlights as needed resp. how much other colors/shades one
is able to sacrifice.
original
emphasis put on highlights: 0%
emphasis put on highlights: 10%
emphasis put on highlights: 50%
emphasis put on highlights: 100%
As one can see, since the maximal color palette here has 256 entries, with
more emphasis put on the highlights, one needs to give up on some other
colors/shades from the palette.
Some real world comparisons.
Here's a shoot of
Vienna's Volksgarden, which is drowned in a sea of roses
around this time of the year. You should visit this place, your gf will love
you for it!
original
left: median-cut, right: missile's highlighter
As one can see, without the highlighter the image looks dull. While using
just the median-cut (left), the most important aspect is lost, the red color
of the roses making the picture alive. Of course, you have to trade in some
other colors here, which can be seen in the sky (have you even noticed?) but
can be countered with a little bit of dithering.
So using this algorithms, I can now control how the highlights descent down
into a palettized colored world. Given computer generated images, this will
come in quite handy, because the highlights are usually a bit more expensive
to compute and are at times the only aspect of an image making it pop. Hence,
keeping them alive while down-conversion won't waste all the computation time
and still make the low-colored image pop. Of course, this can also have some
advantages in making animated-gifs in terms of quality improvements. Different
story.