Mobile app version of vmapp.org
Login or Join
Martha945

: How to calculate other colors with the same perceived lightness as a given gray value? This is related to a question I asked on tex.stackexchange, which has a color aspect. The result of that

@Martha945

Posted in: #Color #ColorSpaces #ColorTheory

This is related to a question I asked on tex.stackexchange, which has a color aspect. The result of that question is the following image:


I have drawn a series of gray squares on the left, with a red branch departing to the right. The goal is to have different red squares with a different saturation, but all with the same gray value. In the hsv color model, they all have the same v, but when I convert the image to grayscale using Gimp, they are not converted to the same gray. Also the visual impression is that the red squares on the right are darker than those on the left.

How can I, given a certain gray, calculate colors with a certain hue and the same gray value (or, even better, with the same gray impression)? The colors used in the image are all calculated, so I prefer solutions that incorporate calculations as well.

I might have used wrong terms here - I'm a mechanical engineer, so please correct me where appropriate, or ask for clarification.



The suggestion to use the Lab color space has led me to some conclusions:


I can use the Lab model's L value to set some kind of gray value for different colors. In the hsv model this is v. I'm not sure if I am actually allowed to compare those, but I'll do it until someone complains.
In the hsv model I can also set some "base color" (a hue), which I can't find in the Lab model.
In the hsv model, I have 2 constants (in the image above: h = 0, v = 0.375) and one variable (s).
Up to this point, I only have one constant in the Lab model. That is not enough to generate something similar to what I already made with the hsv model.


I guess it's time for experiments.



Done! After I got the conversion code running, it was wuite easy. The first step was to define the "target red" on the right. I calculated RGB2Lab(255,0,0) and changed the L value of the result to the desired L in the figure (L = 62.5). The colors are calculated using a linear interpolation in Lab space from (L,0,0) to (L,aTarget,bTarget). The result:



Thank you!

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Martha945

2 Comments

Sorted by latest first Latest Oldest Best

 

@Frith110

So, the above advice from Nick only works for 50% Luminance.
If you apply any other L value same to different colors, the gray result is different.

There must be a math for that, but you can do it on-screen by-eye.

If you create all the colors you want and then lay a gray element (illustrator) or layer (photoshop) with its transparency mode to "color" (or saturation or hue), that'll make all the elements below to reveal its luminosity.

You should make sure all the colors below that gray element have a saturation of 100, or you'll have gray-ish results, rather than nice colors.

Now, the problem is: With all the methods above, you'll make all the elements the "same luminosity inside the used RGB profile", i.e. same gray for the selected "device", and the worst part: The eye is a device, and there are differences.

You can show the same colors to different people and they will not find the same "evenness" as others.

Add that to the fact that you are setting those colors as "same luminosity" in the selected device, and not only are they all "estimated", as soon as you show it in a different device, the effect will fail, because every device has its own ability to light the red green or blue elements with different intensities, so you could be getting, e.g. red-er elements.

Also, if you make a blend from a gray to a color as above suggested, you have to make sure the gray element has at least 1/255 minimum in every channel (i.e. not longer gray) or the software will consider the origin gray as 0-hue, which will give you red-ish middle tones (because a blend between 0 hue and any other color will be half-way towards a red)

I'm a pre-press expert since '90s and my advice is: if you are going to go with the math, you should use the math for the eye (visual capabilities) as well as the ones for the device you will be showing those numbers on.

Good luck.

10% popularity Vote Up Vote Down


 

@Martha945

You could use Lab colour space to find your matches. Colours with the same L value as your target gray will look nearly identical when converted to grayscale.

For example, a Lab gray of (50, 0, 0), will look very similar to the Lab reds (50, 30, 0), (50, 50, 30), and (50, 50, 50) when converted to grayscale. Samples below use Photoshop (Image > Mode > Grayscale) to convert from Lab to gray:

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme