Talk:HSV color space
HSV color space received a peer review by Wikipedia editors, which is now archived. It may contain ideas you can use to improve this article. |
This is the talk page of a redirect that targets the page: • HSL and HSV Because this page is not frequently watched, present and future discussions, edit requests and requested moves should take place at: • Talk:HSL and HSV |
This redirect does not require a rating on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | |||||||||||
|
Early discussion
editIs this the same as "HSB" (which Photoshop uses)? -- Tarquin
- I believe so (the 'B' probably stands for 'Brightness'), but HSV is the term I've seen most frequently. --Wapcaplet
- Both are correct. However, I've never heard of a color space. Isn't that supposed to be a color model? --mav
- Color space is appropriate, because a particular color model will give a particular gamut of colors. For example, the RGB model contains more visible colors than the CMYK model. (There's a third model, I believe it's called Lab Color, that is larger than either of them, and contains them both). Though you are right that it probably doesn't apply to the HSV model, since HSV is, as far as I know, just a different way of interpreting the RGB color space.
- "Space" is also a mathematical term referring to a set, for example, all vectors are in vector space, all points are in 2-space (2-D) or 3-space (3-D) or 4-space... In this case, every color in the HSV color space corresponds to a point in 3-space. Viewing it as a cylindrical object corresponds to cylindrical coordinates: Saturation corresponds to Radius, Hue to Theta (angle), and Value to Height. --zandperl 23:48, 15 Apr 2004 (UTC)
Are you sure that V = min(R, G, B) is correct? If correct, bright red would have V = 0 but bright white would have V = <max>: this seems wrong.
- I think you're right; in the GIMP, bright red has a saturation and value of 100% (as do any other colors with 100% R, G, or B). This formula looks a little suspect to me... I wonder where it came from. -- Wapcaplet 23:13, 22 Feb 2004 (UTC)
Good job fixing these equations; I was actually mixed up by the max/min error when I looked at this page just last week! Just returned to fix it now that I've figured it out and now that I have a user account, but you already did it :).
I think we need to fix the parts at the top that say "Measured in values of ... by the ... wavelength". I don't think this is really the right way to talk about HSV; HSV isn't ever really "measured", like you wouldn't take your spectrometer and try to read off HSV values from it. HSV is generative; you specify it and then your computer or other device generates some wavelengths to approximate your specifications. The parameters of HSV don't really correspond to any physical properties like wavelength though, except so far as your computer screen is able to translate them, which differs from screen to screen. Anyway, the current description as the "amplitude", "spread", etc. of wavelength are certainly not right. I'll fix these sometime soon if I can find time to come up with a more correct description. Unless someone tells me I don't know what I'm talking about (I think I do...).
--Chinasaur 09:45, Feb 27, 2004 (UTC)
- Thanks :-) I agree with your alterations, too; you're absolutely right that the correspondence between HSV values and physical measurements is weak at best---if the 0-360 degrees of hue mapped directly to wavelength, we'd have a lot more green than necessary, and no purple; "amplitude" and "spread" seem more like general concepts, rather than actual physical characteristics. I've touched things up a little. It'd be nice if we had a couple of paragraphs about how HSV was conceived and developed, and why... -- Wapcaplet 21:14, 27 Feb 2004 (UTC)
- Boy, harder than I thought to find out the details of how HSV was developed. Alvay Ray Smith developed it sometime in the 1970s; the first paper published on it seems to be in 1978, Color Gamut Transform Pairs (by Smith). Full PDF is available to ACM members, which I unfortunately am not. Apparently there used to be a bio of Smith on Microsoft's research site, but it looks to be gone. Anyone know any more details than this about HSV's development? -- Wapcaplet 21:38, 27 Feb 2004 (UTC)
I think I understand now what the "amplitude" and "spread" descriptions are trying to talk about, but they were backwards in the version I edited.
Saturation can sort of be thought of as the spread of the power spectrum, except that it is an inverse relationship; if you were looking at a narrow band of pure spectral color, that would correspond to a narrow band in physical frequency space. As you spread the frequency space band, the color would begin to appear washed out (hue might also shift a bit though), i.e. saturation would decrease.
Likewise, amplitude in the frequency domain (or time domain, but thinking spectrally makes more sense) is an okay analogy to HSV Value, although Value is not actually very cleanly related to radiant intensity (e.g. radiant intensity clearly increases as you desaturate a color, but HSV Value doesn't change in this case), or even psychophysical luminance (which I think is represented in CIE XYZ by Y).
So I'll probably put back at least the spread idea (but for Saturation, not Value). The amplitude idea is not very clean, plus confusing since amplitude is usually a wave property and that's a bad way to think about non-spectrally-pure colors. Plus understanding Value as max(RGB) is simple and doesn't seem to need a better intuitive analogy, while delta/max for Saturation might not give an obvious intuition so the spread idea is probably worth giving.
- Well, nope I decided to take them back out again. The new edit has a new paragraph after the initial definitions. It may be too talky/technical, but it's the best way I can think to deal with a complicated issue for now. Maybe the img links should be moved up now so that they are visible right away on small screens; I think they add a lot to the impression of the page. Dunno how to do that yet though. Sorry for all the editory flailing so far; I'm pretty new at this, not very version number efficient...
--Chinasaur 00:39, Feb 28, 2004 (UTC)
Cone or cylinder?
editActually, mathematically it makes more sense to describe the HSV space as a cylinder instead of a cone. After all, the allowed range of the saturation parameter does not decrease when the value is decreased. -- Hankwang 20:07, 6 Mar 2004 (UTC)
- That's true in theory, but in practice, when the RGB values are constrained to a finite amount of precision (say, 8 bits each), a decrease in value does effectively reduce the number of discrete values in saturation. For example, when value is at 100%, the full range of saturation (0-100%) maps to the full range (0-255) of discrete RGB values; when value is reduced to 50%, the saturation range only maps to half (0-127) the number of discrete RGB values. When value is 0%, saturation is irrelevant, since it's always black (regardless of saturation). The same could be said for hue; as value is reduced, the number of discrete hues (around the circumference of the HSV cone) is reduced, until when value is 0% hue is also irrelevant. I'm guessing the color cone model is a result of using a fixed amount of precision for each component.
- This should probably be explained in the article though; in an abstract mathematical model with infinite precision, a color cylinder does indeed make more sense. At any rate, the color cone is just one of many different ways to visualize the HSV space; there's no reason we can't have both. -- Wapcaplet 21:31, 6 Mar 2004 (UTC)
- I understand the issues with precision and I'd personally rather depict color space as a cone than as a cylinder. However, my problem in the case of HSV is that the coordinates are clearly cylindrical (phi, R, z) coordinates, but the cone representation suggests that you can add color vectors. For example, in cylindrical coordinates, (phi,R,z) = (0,100,1) + (180,100,50) will give (0,0,51), while HSV colors with those values, when mixed, will give something like (180,99,51).
- The article, showing both the cone and cylinder representation, is better now, though I liked the old "sliced-cone" picture better than the new one. The brain interprets the smoothly varying colors as shadows (related to the shape of the object), which makes a visualisation as a cylindrical object hard. I'd suggest to put a coordinate grid on the figures. -- Hankwang 14:46, 7 Mar 2004 (UTC)
- I am not sure I understood that math part, so I will take your word for it :-) I will see about tweaking the images a little to make them clearer. -- Wapcaplet 18:38, 7 Mar 2004 (UTC)
- OK, I couldn't think of a really good way to show coordinates, so I've opted instead for a cutaway view; I think it helps to understand the visualizations a little better. Lemme know what you think. -- Wapcaplet 20:51, 7 Mar 2004 (UTC)
- Much clearer now (the full surface grid that I had in mind might make the picture too crowded). One more thing: it makes more sense to let the hue arrow start at red (H=0) and point counterclockwise (i.e., towards increasing H). Then you can let the hue arrow stop at the blue cut and make the side picture correspond to the blue cut instead of the purple one. Even better, rearrange the picture such that the cut is at a color for which the eye is more sensitive than blue, e.g. orange or green. A dark background may also help to see what is happening at lower values.
- BTW, I didn't know that these things were possible with the Gimp. -- Hankwang 23:27, 7 Mar 2004 (UTC)
- The original ones were made in the GIMP, but this time around I made a 3D model in Blender. I wasn't able to get the texture mapping right for the cutaway sections, though, so it's still largely GIMPped. It could be done all-GIMP, though. I just felt lazy. They could still use some work; I'll see about implementing your suggestions. -- Wapcaplet 23:59, 7 Mar 2004 (UTC)
Vandalism
editIP 128.174.154.152 (ctl22.lis.uiuc.edu, apparently someone from University of Illinois at Urbana-Champaign) blanked the page this evening. There was no note of explanation or evidence of a page move, so I reverted to the previous edit.
Chinasaur 05:26, Mar 17, 2004 (UTC)
- You can leave a polite message such as {{subst:test}} on the user's talk page. If a user persists in vandalism (a warning is already present on his talk page), report it on Vandalism in progress - the user may be blocked. -- Hankwang 09:53, 17 Mar 2004 (UTC)
Requesting peer review of dominant wavelength --Chinasaur 18:39, Mar 19, 2004 (UTC)
Problems with the formula
editsee: User:Kim Bruning/colorspace.py
When then , and hence , so that each of the calculations for h is a division by 0.
if MAX=0, then V=0 , and calculating S is a division by 0.
let's see... hmm, so putting that better:
- if V = 0, then S = undefined
- if S = 0 or S = undefined, then H = undefined.
Okay, I've fixed the programme to deal with it:-)
Kim Bruning 20:43, 6 Apr 2004 (UTC)
Nooope, wait, it's STILL wrong if any of
- R=G
- G=B
- R=B
Then the formula is undecided again, since there are 2 possible values for H!
Found out while trying to make up a color for yellow :-/
Okay, I have no clue if there's a mathemagical way to deal with that, but the formula here is really quite tricky to code ^^;; I'll ask for peer review.
Kim Bruning 21:05, 6 Apr 2004 (UTC)
Here's a slightly different formula: http://www.easyrgb.com/math.php?MATH=M20#text20 Kim Bruning 21:19, 6 Apr 2004 (UTC)
Fixed the progamme! All hail and thanks to Chinasaur for helping me with both the formula, and the code! :-) Kim Bruning 14:59, 7 Apr 2004 (UTC)
- Why not just use the formula in the Hue article?
- where R is the red value, φ is hue, σ is saturation and μ is value. Denelson83 04:11, 31 Dec 2004 (UTC)
Good idea; it's nice and concise. My math is poor, though; would one still obtain saturation and value in the same way (since those are preliminary to finding hue)? The hue article doesn't explain the range of μ and σ (is it again between 0.0 and 1.0?) -- Wapcaplet 23:57, 31 Dec 2004 (UTC)
Formula incorrect?
editOn HSV color space#Transformation from HSV to RGB. The six results for Hi use a variable v (small letter, italic). This variable is not present in de formulas above, ie is is unknown & has no value when used in Hi's. I think this is not correct. First thing I expect (fwiw): if six H's are possible, thats the six sequence-combinations of p, q, t. User:DePiep 14:45, 24 May 2005 (UTC)
Minor clarification
editOn HSV color space#Transformation from HSV to RGB.
The outcome makes an pre-exeption for when S=0 (no hue). For just above the maths it states: When S is non-zero, the following formulas can be used.
To me it seems that the functions can also be used when S=0 (no risk of division-by-zero). Is it more correct, then, to put the S=0 remark afterwards, as an illusttration (and not an part of the formulas). -DePiep 14:52, 24 May 2005 (UTC)
Major clarification
editSee the part HSV color space#Transformation from RGB to HSV.
Here I expect the S=0-situation to be mentioned before the H-formulas, since that does introduce a division-by-zero possibility. Isn't it more maths & logic to create a one-way route throught the formulas? -DePiep 15:00, 24 May 2005 (UTC)
Why not a sphere?
editIs it possible to represent the HSV colour space as a sphere, where value corresponds to latitude, hue corresponds to longitude, and saturation corresponds to distance from the centre of the sphere? Denelson83 04:57, 29 October 2005 (UTC)
- I don't see why not. A spectrum around the equator, black and white at the poles, with a creamy grey center. Probably any 3D geometric shape could be made to serve; just depends on how you want to visualize it. -- Wapcaplet 17:52, 29 October 2005 (UTC)
- I think that a sphere would be more suited to the HSL color space. HSV is best represented by a shape with a flat top, whereas HLS is best represented by a shape that is symetrical on the L=0.5 plane. Ae-a 09:25, 27 February 2006 (UTC)
- Now that I think of it, a semi-sphere might be suitable for HSV. An upside-down cone or a cylinder might also be suitable. Ae-a 09:35, 27 February 2006 (UTC)
- There's a spherical model that I made over at the HSL article. I personally find it the easiest to grasp. -SharkD 08:24, 23 October 2006 (UTC)
- Now that I think of it, a semi-sphere might be suitable for HSV. An upside-down cone or a cylinder might also be suitable. Ae-a 09:35, 27 February 2006 (UTC)
Hue clarifications
editSince hue is an angle on the colour wheel thinger, it is measured in either an angle (0.0°–360.0°) or a percentage (0.0%–100.0%). However, most mathematicians (and physicists) tend to use radians (0–2π) as a linear method of angle measurement. I don't know if the HSV specs allow for angles to be supplied in radians, but I think the article should mention something regarding angles being measured in degrees and not in any other angular measurement. I know it might seem somewhat esoteric, but it confused me at first when I read the equations.
HSV to RGB formula seems to always work
editArticle says:
First, if S is equal to 0.0, then the resulting color is achromatic, or grey. In this special case, R, G, and B are simply equal to V. As above, H is irrelevant in this situation. When S is non-zero, the following formulas can be used:
But the formulas seem to work fine in the special case — there's no division by S, and p, q, t, R, G, and B all get set to V in all cases. Deco 05:57, 12 May 2006 (UTC)
- True, it's a bad wording. The S=0.0 Special case is useful. Perhaps it's better to say "When S is non zero, the following general case applies:" or some such? Kim Bruning 14:55, 19 July 2006 (UTC)
Perhaps my math is lacking, but why does the transformation to RGB over at Hue differ from that listed in this article? The one in this article appears to work, but I have not managed to get the one at Hue to work. I may just be misinterpreting it, though. Could someone clear this up? Thanks. --Orborde 03:49, 25 June 2006 (UTC)
- Hmm...I tried both (to the best of my ability), and it appears that the method listed at Hue is incorrect. Behold the pretty picture:
.
- The top uses the method listed at Hue, and the bottom uses the method from HSV color space.--Orborde 04:26, 25 June 2006 (UTC)
- I noticed this as well. The formulae in Hue use a sinusoidal RGB distribution over the range of hues, while the formulae in HSV color space utilize a linear distribution. The following image summarizes the difference:
- As you can see, the sinusoidal distribution is much smoother. However, you will also notice a distinct lack of saturated yellow, cyan and magenta in this color space. Yellow would show at a hue of 60o, with full green and red components but no blue component. At 60o in the sinusoidal model, neither green nor red is at 100%, leading to an unsaturated yellow. I should note that this sinusoidal model is not identical to that found in Hue, but can be found as follows:
- Converting from sinusoidal HSV to RGB
-
- Converting from RGB to sinusoidal HSV
- With a little research it seems ([2], [3]) that the linear model is the established standard, but I see no reason not to include both. While I can say that the model I have provided above is mathematically rigorous, Wikipedia is not a publisher of original thought and I am unable to find it referenced anywhere. (3ucky(3all 23:20, 26 June 2006 (UTC)
HSV wrong image
editThe arrows in the image Image:HSV_clr_whl.png are wrong. The current image implies incorrectly that you cannot change "V" when "S" is at maximum. It also implies that with V at minimum you could change the color by changing S which is also wrong. Instead, the S arrow should go from total white to totally saturated green and the V arrow should start at total black and be orthogonal to the S arrow. -Oxygene123 11:43, 10 October 2006 (UTC)
Just wanted to add that I agree with the above, and was just about to post the same comment when I saw this. The S arrow should be parallel with the top-right triangle edge going from white to green, and the V arrow should be perpendicular to it from the black corner to the .5-saturated green in the center of the top-right edge. -User:Spitzak
After pondering this and reading a shitton about different color spaces, I think that the cylindrical and conical images of HSV are incorrect. Both are sliced at the 50% mark in the V direction, the V value in the middle of the cylinder or cone should be grey and the cylinder or cone should go back up to white (it is black at the bottom). Maybe this was implied by the images but if so it should be stated in the descriptions or text Jackkoho 19:55, 2 January 2007 (UTC)
References
editWhy this is markes as unreferenced if there is a reference at the bottom? is that reference wrong or the signal should be removed? --Samus uy 00:07, 23 October 2006 (UTC)
Not the same?
editThe HSL article states that HSV and HSL are different. Which article is correct? -SharkD 08:23, 23 October 2006 (UTC)
- The HSL article ir right, they are different. I've fixed this along with the "HSV color wheel" image. --Samus_ 11:57, 23 October 2006 (UTC)
Animations necessary?
editSpeaking as a somewhat educated layman on the issues who's just checking in to remind himself of a few things, I think the article's good -- I was able to refresh my memory on the important points -- but I find the animated color space images extremely irritating. They totally disrupt the experience of trying to read through or refer to the page, without any significant benefit. It would be more appropriate to link to the images, or better yet display or link to an image that lets you manually control your view of the color space. As it is, having the page open makes me feel like I'm standing on one of those Saturday Night Fever dancefloors... not helpful to the design process.
Also, the "chart" section for viewing "precisely the effect of varying levels" could use expansion. I know a fair bit about HSV-vs-RGB-vs-YUV and so on, and it still took me a few minutes and a bunch of looking up and down to grasp what's going on in these illustrations. The average reader is not going to learn anything.
-- Anonymous non-wiki-guy —The preceding unsigned comment was added by 66.93.144.192 (talk) 03:54, 8 January 2007 (UTC).
- Heh, there is animation? I use the Firefox "Web Developer" add-on to force no animation. The web is a much nicer place that way... 2*6 14:02, 10 January 2007 (UTC)
Does anyone else support the removal of the animated images? I do not believe they add much to the article and are very distracting from the textual content. Alternatively, replace with static images? ChrisRBennett 01:23, 15 August 2007 (UTC)
I would support removing them; they appear to be redundant. Alternatively, I might be able to tolerate one animated image that's not too flashy, but not multiple ones. Dicklyon 02:36, 15 August 2007 (UTC)
Subcategories in "Visualization of HSV"
editI added the "hueborhood" image and description to the bottom of the section. The new image kept causing layout problems as the system kept trying to figure what image goes where and with what text. The only way I could figure out to halfway keep the set of two images interacting with the new one was to add subcategories. It's not an ideal solution; if a wiki expert can figure out some other way, it would be great. Thanks. 2*6 14:02, 10 January 2007 (UTC)
- Ah, found the fix to the layout problem. It was a matter of using the CSS template "clear". See WP:BUNCH#Clearing_the_floats. Now I sorta like the subcategories, so left them in. 2*6 22:25, 10 January 2007 (UTC)
- I just happened to read the No original research guideline. It led me to wonder whether the "hueborhood" image and explanation are even appropriate. On the one hand, it is a relatively obvious way visualize HSV, like taking a microscope to one portion of it, grabbing a 3x3x3 stack of close colors, and sorting them. Is this fundamentally different than the other visualizations offered? On the other hand, I have certainly coined the word "hueborhood", which the guideline would seem to prohibit. And the HSB application which generated it is my own interactive color wheel. So if another editor decides to revert my addition, I'll understand. 2*6 15:44, 10 January 2007 (UTC)
- Coining a word is, if not original research, not in the spirit of an encylopedia; you should remove that and substitute a description as needed. As for the more important point of the image, my personal opinion is that it's not really different than (say) taking a photograph of the Empire State Building from an unusual angle - say, from a blimp, directly above. Unless, of course, you're arguing that the image proves something about (say) how the 6th dimension really works. John Broughton | Talk 02:38, 11 January 2007 (UTC)
- John, thanks for the feedback. I have removed the word "hueborhood" from the article (although it remains the name of the image itself). Regarding my 6th dimension research, I've got the article mostly written -- just waiting now to see if the puppy makes it back. ;) 2*6 04:24, 11 January 2007 (UTC)
- As I've heard it, images are only supposed to illustrate and support the text of the article. They're not really part of the "content" of the article, so WP:OR doesn't apply exactly. As for the word "Hueborhood" itself, we have a guideline that covers this: Wikipedia:Avoid neologisms.
- I think the image and few others need to be better integrated into the article as well. We don't necessarily want a endless gallery of different ways to visualize the HSV concept. Each image should be illustrating a different concept related to the text that accompanies it.
- What I'm particularly concerned about is the link to your website. While I greatly appreciate your contributions, it can be difficult to be objective about one's own website and whether it merits a link. (See WP:EL for what kinds of links are and aren't appropriate.) I've removed it for now. If you think it is important to the article, you should explain why here, but please wait for another editor to add it back rather than adding it yourself. – Þ 05:41, 11 January 2007 (UTC)
- The link was a "cite web" footnote, the first actual citing of sources in the article which is flagged as not citing sources. It provides a little more information about a hue neighborhood, as well as allowing users to generate other such views into the HSV space. I also felt it was particularly appropriate here, as my page's interactive color wheel demonstrates HSV in a more dynamic and intuitive form than the animated GIFs within the article. That's my case for the citation; if no one chooses to add it back, though, I won't either. 2*6 06:43, 11 January 2007 (UTC)
- John, thanks for the feedback. I have removed the word "hueborhood" from the article (although it remains the name of the image itself). Regarding my 6th dimension research, I've got the article mostly written -- just waiting now to see if the puppy makes it back. ;) 2*6 04:24, 11 January 2007 (UTC)
Figures no printed
editHello (:-) 11 01 2007 The figures right page 1, 2 and 3*3* Hue Neighborhood page 3 and right page 5 Are not printed
Vidiani (Dijon)
—The preceding unsigned comment was added by 89.85.64.106 (talk) 10:28, 11 January 2007 (UTC).
- Hi. I've seen that behavior also, but it corrected itself in a minute or two. My guess is that the servers sometimes get backlogged, and serving up images is allowed to be at a lower priority than the articles themselves. The images are showing right now. 2*6 11:02, 11 January 2007 (UTC)
- Images come from a different server altogether, so if the one is briefly having a hiccup, you'd see the behaviour you mention. --Kim Bruning 21:53, 15 September 2007 (UTC)
Number of colors reduction
editThe text:
Certain RGB colors have no integer HSV representation. In fact, only 1/256th of the RGB colors are 'available' in HSV, effectively eliminating a single channel of control from the graphics artist.
is wrong. My, not particularly smart, implementation of the HSV color space reduced the total 16 millions colors to about 7.5 millions. That is around 45% of the original number, but definitely more than 1/256th. --Prydeson 22:36, 8 February 2007 (UTC)
- Yes, it is wrong. The worst it gets in any region of the RGB space is the area that the top outside edge of the HSV cone maps to. There about 1/6 of the RGB points are mapped to by some HSV point because the 256 point hue parameter has to be stretched to cover six RGB cube edges, each with 255 points.
- I've tried to rehabilitate the paragraph, but I doubt whether it is worth keeping. If it is kept, maybe something similar should go in the HSL article. DCary 06:54, 19 February 2007 (UTC)
- I think that now it is much better. Clear example and problem description, thus definitely worth for the inexperienced reader. --Prydeson 23:26, 22 February 2007 (UTC)
HSV to RGB equation error
edithttp://www.cs.rit.edu/~ncs/color/t_convert.html
The case switching on Hi{0,1,2,3,4,5} should actually be switching on f, no? See above reference.
Please take a look at Luminance-Hue-Saturation as it probably needs a bit of work (I am not the author, I just moved it). Thanks! Fourohfour 13:48, 22 July 2007 (UTC)
- Don't bother. I have treated it as a fork and redirected. -- RHaworth 14:07, 24 July 2007 (UTC)
- Good choice; I had prodded it, finding no support in color books for this divergent concept wrongly attributed to the CIE. Dicklyon 15:13, 24 July 2007 (UTC)
Varying one component
editExcuse my ignorance but could someone please check that the illustration on the left is saturation not intensity? Maybe explain how it was genenerated? 130.130.37.12 01:14, 4 September 2007 (UTC) harryh
- The three major stripes are three differents values (intensities); wihtin each, saturation varies from unsaturated gray on the left to fully saturated color on the right. Seems OK to me. Dicklyon 04:42, 4 September 2007 (UTC)