AuthorTopic: a custom Color Picker (pick from image)  (Read 3701 times)

Offline 0xDB

  • 0011
  • **
  • Posts: 873
  • Karma: +0/-0
  • Dennis inter-is.
    • dennisbusch_de
    • http://pixeljoint.com/p/1287.htm
    • 0xdb
    • View Profile
    • 0xDB

a custom Color Picker (pick from image)

on: March 21, 2016, 07:54:03 pm
I recently learned some more about the importance of Value & Key as I am currently reading Loomis' Creative Illustration.

And with keeping that importance for rendering light and shadow in mind, Value as Perceptual Levels of Illumination, I've grown incredibly dissatisfied with all the existing Color Pickers in Imaging software (including the L*a*b picker which is actually supposed to have consistency for the perceptual level of illumination in the L component but apparently fails at that due to something called the Helmholtz-Kohlrausch-Effect). Krita has an "artistic color picker" which I thought would account for consistent levels but experience showed that it did not.

So what I wanted was a quick way to pick colors of different hues and perceived levels of illumination without having to screw around with a load of sliders and converting back and forth between color and grayscale modes to find equivalent levels across different hues and mix-colors of different hues.

To create the image below (the color picker) I first arranged six different colored lights in complete darkness along a circle (using color gradient generator software I wrote a few years ago) and set the light ranges so that they would at least reach all the way across the circle to the complementary light because not only was I interested in quickly grabbing the usual range of hues but also wanted mixes between hues which are not next to each other on the standard hue wheel (which goes from red to yellow to green to cyan to blue to magenta to red). Also placed an additional white light in the top left to get a grayscale.

I then loaded the image into Krita, duplicated it into another layer which I then converted to Grayscale with the "Perceptual" option provided by Krita. I posterized that grayscale layer to get a few distinct levels(those bands are visible in the final image which is important to tell equivalent levels across different hues and light mixtures).

In a final step The posterized grayscale layer is combined as "Luminosity" with the Layer containing the six mixing lights.

Of course the resulting color picker does not provide the full RGB space but it's a good starting point and will greatly reduce the time needed to find colors of equivalent levels and create ramps for pixel art:

Offline 0xDB

  • 0011
  • **
  • Posts: 873
  • Karma: +0/-0
  • Dennis inter-is.
    • dennisbusch_de
    • http://pixeljoint.com/p/1287.htm
    • 0xdb
    • View Profile
    • 0xDB

Re: a custom Color Picker (pick from image)

Reply #1 on: March 22, 2016, 01:22:31 pm
Following a similar process but this time starting from complete lightness and placing six different light absorbing sources (six "darkness sources" instead of six light sources), here's a similar picker for working in High Key:

Offline 0xDB

  • 0011
  • **
  • Posts: 873
  • Karma: +0/-0
  • Dennis inter-is.
    • dennisbusch_de
    • http://pixeljoint.com/p/1287.htm
    • 0xdb
    • View Profile
    • 0xDB

Re: a custom Color Picker (pick from image)

Reply #2 on: March 22, 2016, 02:16:36 pm
In the 256 colors (including index 0 for transparency) reduction, finding good ramps and colors which can be shared by ramps is as easy as travelling across the map from distinct patch to adjacent distinct patch.

The bands of equivalent levels of perceived value are a bit destroyed though, so there will be a bit of error in value equivalence even while travelling inside the same band.


Offline Atnas

  • Moderator
  • 0100
  • *
  • Posts: 1074
  • Karma: +2/-0
  • very daijōbs
    • paintbread
    • paintbread
    • View Profile

Re: a custom Color Picker (pick from image)

Reply #3 on: March 22, 2016, 02:29:05 pm
This is an interesting way to pick colors... I usually just create colors with RGB and eye how it interacts with the usual neighbor colors as i tweak the channels, but I can definitely see the use for this in a project to explore new colors as they relate to your already established palette. Maybe setting the sources to stylized versions of primaries as found in an existing work can help find some more unity when adding new colors. Will play with this.

I'm also interested in how using a different background could establish an underpainting type of feeling.

Offline surt

  • 0011
  • **
  • Posts: 570
  • Karma: +0/-0
  • Meat by-product
    • not_surt
    • http://pixeljoint.com/p/2254.htm
    • View Profile
    • Uninhabitant

Re: a custom Color Picker (pick from image)

Reply #4 on: March 22, 2016, 07:42:41 pm
Draw topographic contours over the top to mark value bands?

Offline Ai

  • 0100
  • ***
  • Posts: 1057
  • Karma: +2/-0
  • finti
    • http://pixeljoint.com/pixels/profile.asp?id=1996
    • finticemo
    • View Profile

Re: a custom Color Picker (pick from image)

Reply #5 on: March 23, 2016, 05:38:23 am
I've grown incredibly dissatisfied with all the existing Color Pickers in Imaging software (including the L*a*b picker which is actually supposed to have consistency for the perceptual level of illumination in the L component but apparently fails at that due to something called the Helmholtz-Kohlrausch-Effect)
A better way of putting that is that it is imperfect. It's still notably closer to the mark than most color spaces, which mostly don't really try that hard to be perceptually uniform.

Also, have you tried BruceLAB profile (by Bruce Lindbloom? It's intended to repair as many of the noted irregularities in LAB as is possible.
It seems to depend on a paint program that supports editing in LAB colorspace (so, PS or Krita).



Quote
So what I wanted was a quick way to pick colors of different hues and perceived levels of illumination without having to screw around with a load of sliders and converting back and forth between color and grayscale modes to find equivalent levels across different hues and mix-colors of different hues.
.. That sounds like you want Munsell color charts.
If you insist on being pessimistic about your own abilities, consider also being pessimistic about the accuracy of that pessimistic judgement.

Offline 0xDB

  • 0011
  • **
  • Posts: 873
  • Karma: +0/-0
  • Dennis inter-is.
    • dennisbusch_de
    • http://pixeljoint.com/p/1287.htm
    • 0xdb
    • View Profile
    • 0xDB

Re: a custom Color Picker (pick from image)

Reply #6 on: March 23, 2016, 12:21:55 pm
This is an interesting way to pick colors... I usually just create colors with RGB and eye how it interacts with the usual neighbor colors as i tweak the channels, but I can definitely see the use for this in a project to explore new colors as they relate to your already established palette. Maybe setting the sources to stylized versions of primaries as found in an existing work can help find some more unity when adding new colors. Will play with this.

I'm also interested in how using a different background could establish an underpainting type of feeling.
I'll be interested in what you find in your exploration of this.

Draw topographic contours over the top to mark value bands?
Thought about it but it seems like the reduction butchers the values too much, so that the bands become quite fragmented and the transitions are not as clean as in the 32bpp version. In the 256 color version, values inside some bands jump up and down too much to draw clean contours... maybe if I redo the whole process with just 8 distinct value bands and then isolate each band separately, reduce to 16 unique colors per band, recombine, repeat for the high key version, combine both... then in theory, I'd end up with 8 clean high value bands and 8 clean medium to low value bands, 16 colors per band (somehow even reducing each isolated band will probably melt the colors in a way that the values get butchered a bit).... well this almost calls for a programmed solution to calculate all that.

I've grown incredibly dissatisfied with all the existing Color Pickers in Imaging software (including the L*a*b picker which is actually supposed to have consistency for the perceptual level of illumination in the L component but apparently fails at that due to something called the Helmholtz-Kohlrausch-Effect)
A better way of putting that is that it is imperfect. It's still notably closer to the mark than most color spaces, which mostly don't really try that hard to be perceptually uniform.
If it fails, it fails regardless of how it is phrased. Saying that I'm incredibly dissatisfied is already the most accurate way to put it as it is closest to the truth of the situation.

Also, have you tried BruceLAB profile (by Bruce Lindbloom(? It's intended to repair as many of the noted irregularities in LAB as is possible.
It seems to depend on a paint program that supports editing in LAB colorspace (so, PS or Krita).
Interesting. Tried that now but it appears that Krita likes to crash a lot if I repeatedly pick different numbers across the various sliders with that profile (also noticed that the perceived levels of illumination still fluctuate wildly even with that :/ and well... it does not eliminate the need to dabble with the sliders a lot for picking colors and mixtures between different lights/hues ).

Quote
So what I wanted was a quick way to pick colors of different hues and perceived levels of illumination without having to screw around with a load of sliders and converting back and forth between color and grayscale modes to find equivalent levels across different hues and mix-colors of different hues.
That sounds like you want Munsell color charts.
Munsell color charts are great. I wish applications would provide a Munsell system color picker which would look similar to the illustration on wikipedia (which would allow selecting the value from the central axis and showing a cross section through the cylinder at the current rotation(hue). That would be really great (also if one could freely change the angles of the plane used to cut through the cylinder).

Offline 0xDB

  • 0011
  • **
  • Posts: 873
  • Karma: +0/-0
  • Dennis inter-is.
    • dennisbusch_de
    • http://pixeljoint.com/p/1287.htm
    • 0xdb
    • View Profile
    • 0xDB

Re: a custom Color Picker (pick from image)

Reply #7 on: March 23, 2016, 12:34:41 pm
Hm... this one: http://pteromys.melonisland.net/munsell/ (source: https://github.com/pteromys/munsell )
looks extremely useful.

Offline Ai

  • 0100
  • ***
  • Posts: 1057
  • Karma: +2/-0
  • finti
    • http://pixeljoint.com/pixels/profile.asp?id=1996
    • finticemo
    • View Profile

Re: a custom Color Picker (pick from image)

Reply #8 on: March 23, 2016, 01:45:44 pm
If it fails, it fails regardless of how it is phrased.
'Fail' lacks accuracy. Putting LAB (which is a, say, 6 on 'perceptual reliability') in the same basket as HSV(a 1 or 2 on 'perceptual reliability') is not apt. It would only be apt if this theoretic 'perfectly perceptually uniform' color space actually existed. (which it maybe could but we have a bunch of basic-color-management messes to fix first)

Quote
Saying that I'm incredibly dissatisfied is already the most accurate way to put it as it is closest to the truth of the situation.
That's fair enough I guess.. Most of the real basic technical stuff about color is still pretty ramshackle. Gamma, resampling, color management, color systems.

Quote
Interesting. Tried that now but it appears that Krita likes to crash a lot if I repeatedly pick different numbers across the various sliders with that profile (also noticed that the perceived levels of illumination still fluctuate wildly even with that :/ and well... it does not eliminate the need to dabble with the sliders a lot for picking colors and mixtures between different lights/hues ).
Good to know.

Quote
Munsell color charts are great. I wish applications would provide a Munsell system color picker which would look similar to the illustration on wikipedia (which would allow selecting the value from the central axis and showing a cross section through the cylinder at the current rotation(hue). That would be really great (also if one could freely change the angles of the plane used to cut through the cylinder).
I have checked the followup link you provided.
It works fairly well, looks like it needs color management added. Also being able to actually pick interpolated colors, rather than just display them, is IMO necessary for something like it to become a complete replacement for existing pickers.
« Last Edit: March 23, 2016, 01:52:45 pm by Ai »
If you insist on being pessimistic about your own abilities, consider also being pessimistic about the accuracy of that pessimistic judgement.

Offline 0xDB

  • 0011
  • **
  • Posts: 873
  • Karma: +0/-0
  • Dennis inter-is.
    • dennisbusch_de
    • http://pixeljoint.com/p/1287.htm
    • 0xdb
    • View Profile
    • 0xDB

Re: a custom Color Picker (pick from image)

Reply #9 on: March 23, 2016, 03:19:17 pm
I feel saying it fails is accurate if it does not do what one wants it to do. The fact that different models have varying degrees of accuracy does not change the fact that even the most accurate model in existence still fails. But well this feels like discussing semantics which needlessly distracts from the topic. It feels like there is some type of emotional attachment between you and LAB space which might make you feel like you need to defend it or something (even if it is not really under any kind of 'attack') like there probably is some emotional attachment between me and my experiments.

The Munsell-system-based picker aside (which already seems like a huge improvement over other existing pickers commonly in use in imaging software), I still continued to explore making a useful picker(as in 'an image to pick from') which puts a broader variation of mixtures of lights and light absorbers in a single image to serve as a quick starting point for picking colors of equivalent levels of perceived illumination:

This time I actually calculated the positions of the light attractors/absorbers (instead of just "eye'ing in" their positions along the circle) which lead to a cleaner result. Also, this time I first combined both outputs side by side and used IndexColor filtering in Krita to reduce the GrayScaleDuplicate to 16 levels which are shared by both the low/medium key and the high key image.

If anyone wants to play with it, here's a zip containing the new .dcgg files for my old Dynamic Color Gradient Generator, the exported/combined bitmap of the mixtures calculated from those, the Krita file and the output PNG files: http://www.dennisbusch.de/shared/color/CustomColorPicker.zip

In the previous version there seemed to be a lot of levels, especially in the very high and low key regions which were too close together to be useful for pixel art. Also, now the bands of levels don't bleed into each other as much as before in the reduction.

32bpp version '6 light mixtures, 6 dark mixtures, 16 levels':


8bpp reduction indexed version, including index 0 for transparency: