Jump to content

Color selection inconsistency - HSV values randomly dropping by 1


Recommended Posts


Alright, let's say I want to use a color with the HSV value 99, 100, 39, and place a pixel with the color selected

 

J8hcQFt.png.png6sprUSh.png.png

 

Next, select the color picker. Select the white background, and then select the placed pixel, and check the color value.

 

vFHEgBJ.png.pngZyqrd6d.png.png

 

For some reason, the color value dropped from 99, 100, 39 to 99, 100, 38. This happens pretty consistently whenever manually entering color value... except when it doesn't, and upon entering 99, 100, 40, the color stayed at that value without dropping down to 99, 100, 39.

 

The above example, in itself, can easily be considered a non-issue – it's the same RGB value and color hex code after all. So let's move on to another example.

 

gQv4mec.png.png

 

I've got a pixel with the HSV value of 99, 65, 70. Let's see what happens when I try to re-enter '70' manually.

 

rQaoC7Q.png.pngjNmhGqZ.png.png

 

Look at the RGB/Hex value. For some reason, re-entering the same HSV value changed the RGB/Hex value entirely. You could chalk that up to a conversion error. But what's even more surprising is that the HSV value of the placed color isn't consistent with the entered value either.

 

0FPQjOT.png.png

 

Once again, HSV values dropped by one, turning 99, 65, 70 into 98, 65, 69 – and this time, changing the RGB/Hex values entirely.

 

There's something broken about manually entering HSV values that ends up failing to select the right RGB/Hex value, producing completely different HSV values once the color is placed on the canvas.

Link to comment
Share on other sites

The colors in your image are RGB values, and they represent the true/real/actual values.

The HSV vales are just approximations based on the RGB values, and are provided for convenience. They do not represent the true values in your image.

The two color modes (RGB & HSV) are not interchangeable, and there's really no way to 100% accurately convert from one to another. Thus you'll see that "off by 1" behavior.

  • Like 1
  • Upvote 1
Link to comment
Share on other sites

You aren't going to always have a very accurate conversion from HSV to RGB. For the sake of discussion, I ran this code within code filters of g'mic-qt and you'd see the result with display debug.

f [210,1,.75,255] hsi2rgb s c
#RGBA: 0,191.3,382.5,255#

RGBA INT8 has a range of 0-255. Hue of 210 with 100% Saturation and 75% Intensity is equivalent of 0,191.3,382.5. That's not possible with RGBA INT8 restriction.

G'MIC Filter Developer

Link to comment
Share on other sites

Also, I would like to add that RGB INT8 can have a degree of error when converting from HSV to RGB. @toe_head2001 alluded to that, but I'll say it anyway. As you can see with the example above, note the decimal point. RGB INT8 has no concept of decimal point. So, it's not that accurate, but just accurate for production.

G'MIC Filter Developer

Link to comment
Share on other sites

On 2/26/2020 at 3:53 AM, toe_head2001 said:

 

Sorry, that's incorrect. The HEX value represents the RGB value.

 

By "reflect", I meant a match between displayed HSV values.

 

#68B53F had the HSV value of 99, 65, 70. But entering that exact HSV value resulted in #67B23E, which has the HSV value of 98, 65, 69

Link to comment
Share on other sites

Paint.NET uses sRGB absolute color space developed by HP & Microsoft in 1996 and is used as a fast and precise way to create an additive color system to computer devices such as monitors and printers.
 

HSV is a relative color space developed in the 1970s to represent how the human eye perceives the mixing of pigments and apply that mathematics to RGB color space. How it determines Values & Gamma in that color space differs and that is what is causing problems finding exact relationships in the settings within the Paint.NET's expanded Colors Window.

 

Sources:
https://en.wikipedia.org/wiki/List_of_color_spaces_and_their_uses

Edited by HyReZ


 

Link to comment
Share on other sites

3 hours ago, HyReZ said:

HSV is a relative color space developed in the 1970s to represent how the human eye perceives the mixing of pigments and apply that mathematics to RGB color space. How it determines Values & Gamma in that color space differs and that is what is causing problems finding exact relationships in the settings within the Paint.NET's expanded Colors Window.

 

I thought human eye perception color space models would be CieLUV, CieLAB, LCH, and XYZ. XYZ being the primary source.

  

7 hours ago, Lorenerd11 said:

 

By "reflect", I meant a match between displayed HSV values.

 

#68B53F had the HSV value of 99, 65, 70. But entering that exact HSV value resulted in #67B23E, which has the HSV value of 98, 65, 69

 

My guess is that this has to do with rounding. As you can see with the output of gmic-qt code, there's decimal point after 191. Internally, your source either ceiling or round or Paint.NET either floor or round. This would be something @Rick Brewster can answer as none of us other than @Rick Brewster has access to. If it were up to me to change how this works, I would use round than ceiling or flooring to have more accuracy.

Edited by Reptillian

G'MIC Filter Developer

Link to comment
Share on other sites

43 minutes ago, Reptillian said:

 

I thought human eye perception color space models would be CieLUV, CieLAB, LCH, and XYZ. XYZ being the primary source.

Nope!
HSV (hue, saturation, value) is an alternative representations of the RGB color space model, designed in 1978 by a computer graphics researcher Alvy Ray Smith to more closely align with the way human vision perceives color-making attributes.

HSV colors can have fractional values represent as decimals

You can see references for more nfo.
https://en.wikipedia.org/wiki/HSL_and_HSV

 

Edited by HyReZ


 

Link to comment
Share on other sites

17 minutes ago, HyReZ said:

Nope!
HSV (hue, saturation, value) is an alternative representations of the RGB color space model, designed in 1978 by a computer graphics researcher Alvy Ray Smith to more closely align with the way human vision perceives color-making attributes.

HSV colors can have fractional values represent as decimals

You can see references for more nfo.

 

 

Can you provide the evidence that HSV corresponds with human perception of luminosity/lightness? LAB, XYZ does those by far better, and they're more about human vision than HSV, but they can't be represented in monitors because of the limitations within RGB models. HSV doesn't take into consideration of perceived brightness, and that's what XYZ and its childs address.

Edited by Reptillian

G'MIC Filter Developer

Link to comment
Share on other sites

I just added a reference to my comment above while you were writing your comment.
BTW:
I include a reference in my first comment also.
Since I don't develop software I have to depend on the published information from those who do and since the thread is about RGB vs HSV I will leave it there with the support that I have provided!

 

Edited by HyReZ


 

Link to comment
Share on other sites

3 hours ago, Reptillian said:

My guess is that this has to do with rounding.

 

This. As RGB != HSV the conversion generates errors.

 

11 hours ago, Lorenerd11 said:

#68B53F had the HSV value of 99, 65, 70. But entering that exact HSV value resulted in #67B23E, which has the HSV value of 98, 65, 69

 

Don't enter the HSV values. Work with the RGB values. That is what paint.net uses.

Link to comment
Share on other sites

12 hours ago, Lorenerd11 said:

#68B53F had the HSV value of 99, 65, 70. But entering that exact HSV value resulted in #67B23E, which has the HSV value of 98, 65, 69

 

Just for funnies, I looked online for a converter and found one via rapidtables.com, and entered the hex code (#68B53F).  The HSV values given was 99, 65.2, 71.0.  As you can see, the Values are slightly different from what you have given.  Hence, there are rounding errors taking place behind the scene.  I believe @toe_head2001 is correct.

 

Also, there tend to be a difference in monitors.  Example, I have the iMac and the green color are slightly sharper whereas on the extended monitor using Thunderbolt to HDMI converter, the green color is slightly muted.

knightsig.png

Paint.NET Gallery | Remove Foreground Object Tutorial | Dispersion Effect Tutorial

”An artist should never be a prisoner of himself, prisoner of style, prisoner of reputation, prisoner of success.” ~ Henri Matisee

Link to comment
Share on other sites

2 hours ago, TrevorOutlaw said:

Also, there tend to be a difference in monitors.  Example, I have the iMac and the green color are slightly sharper whereas on the extended monitor using Thunderbolt to HDMI converter, the green color is slightly muted.

For professional work it is recommended to obtain an ICC profile for your monitor and install it using the Windows Color Management option and then calibrating it.
 

Much of the works that I do are large so I use large monitors when I create them. I have a 32 inch monitor for my workstation PC and a 80 inch monitor for my media center PC.

Here is a video link on monitor calibration:

https://youtu.be/f1PCG5hXUmE

 

Edited by HyReZ


 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...