Misplaced Pages

Talk:HSL and HSV: Difference between revisions

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
Browse history interactively← Previous editNext edit →Content deleted Content addedVisualWikitext
Revision as of 06:08, 11 July 2010 editDatumizer (talk | contribs)Extended confirmed users, Pending changes reviewers42,788 edits archive 6 was missing← Previous edit Revision as of 07:49, 11 July 2010 edit undoJacobolus (talk | contribs)Extended confirmed users35,667 edits unfinished discussions archived?: new sectionNext edit →
Line 174: Line 174:
::Well, I don't think the wording of the English is very good. For instance, , ''"Below: two-dimensional plots showing two of a model’s three parameters at once, holding the other constant..."'' I don't think anything is being "held" here, or that someone is "holding" something. I'd think that "keeping" would be more in tune with what is going on. You also say that, ''"Such diagrams often claim to represent HSL or HSV directly, with the chroma dimension deceptively labeled “saturation”."'' Which sounds questionable to me, since "deceptively" sounds a lot like an accusation. You also say, ''"The definitions of ''hue'' and ''chroma'' in HSL and HSV have the effect of warping hexagons into circles."'' However, only some hexagons are being warped, not all hexagons everywhere. Thus it would be better to be specific. Maybe you would care to ask for a third opinion in these circumstances? <span style="border:1px solid #f57900;padding:1px;">] ]</span> 22:53, 7 July 2010 (UTC) ::Well, I don't think the wording of the English is very good. For instance, , ''"Below: two-dimensional plots showing two of a model’s three parameters at once, holding the other constant..."'' I don't think anything is being "held" here, or that someone is "holding" something. I'd think that "keeping" would be more in tune with what is going on. You also say that, ''"Such diagrams often claim to represent HSL or HSV directly, with the chroma dimension deceptively labeled “saturation”."'' Which sounds questionable to me, since "deceptively" sounds a lot like an accusation. You also say, ''"The definitions of ''hue'' and ''chroma'' in HSL and HSV have the effect of warping hexagons into circles."'' However, only some hexagons are being warped, not all hexagons everywhere. Thus it would be better to be specific. Maybe you would care to ask for a third opinion in these circumstances? <span style="border:1px solid #f57900;padding:1px;">] ]</span> 22:53, 7 July 2010 (UTC)
::: First, all of these are grammatical, and perfectly understandable in context. “Holding constant” is widespread usage (that is, is the idiomatic way to say this) in english-language math writing; see for instance (or better perhaps ) which provides many examples of such usage in context from a wide variety of fields and countless reliable sources. “Deceptively” implies that readers could be deceived (which is indeed what happens, we can see, because these usages are perpetuated). It is obvious from context (there is a diagram right next to the text) that the hexagons referenced are regular hexagons centered at the origin, in planes perpendicular to the central axis, and oriented so that one corner is at 0°. Writing all of that would be dramatically unnecessarily wordy. Second, your suggested alternatives are in my opinion clearly worse in every case (in the cases where I thought they were better or equivalent, I adopted your wording): hexagons are always two-dimensional; perimeter is a more complex synonym of edge which additionally implies measurement (which we don’t want to imply here); “the hexagons” and “hexagons” are effectively identical in meaning since precisely which hexagons are specified in the picture rather than the text; your substitution of “them” for “those” is unnecessary since the two have identical meaning in context, and I find “those” reads better, and similarly for changing my colon to a parenthetical, and swapping “instead of” for “rather than”; I believe that “mistakenly” makes this is a not-necessarily-correct statement (the usage of “saturation” is not especially well standardized, and so it could be argued that this use of saturation is not necessarily a “mistake” per se... it does deceive or mislead readers though, because it confuses what this article (and some of the earliest and most precise sources) calls "chroma" with HSL or HSV "saturation", and from context it is quite clearly not implying any malicious intent, which wouldn’t even make sense); in the fig. 14 caption my version is IMO clearer and more concise; re: fig 15, this was discussed above, and I suggest you try to get a consensus before changing this back (since it involves changes to images as well as to the article, meaning your revert only of the article text removes several explicitly referenced images – confusing to say the least); gamut is not the area of the plot, but is linked earlier to the article on gamut for readers unfamiliar with the term, and your “according to” here is unnecessarily verbose. Your “Further Reading” → “Further reading” change is proper, and I’ll put it back (I didn’t notice it before). –] ] 01:12, 8 July 2010 (UTC) ::: First, all of these are grammatical, and perfectly understandable in context. “Holding constant” is widespread usage (that is, is the idiomatic way to say this) in english-language math writing; see for instance (or better perhaps ) which provides many examples of such usage in context from a wide variety of fields and countless reliable sources. “Deceptively” implies that readers could be deceived (which is indeed what happens, we can see, because these usages are perpetuated). It is obvious from context (there is a diagram right next to the text) that the hexagons referenced are regular hexagons centered at the origin, in planes perpendicular to the central axis, and oriented so that one corner is at 0°. Writing all of that would be dramatically unnecessarily wordy. Second, your suggested alternatives are in my opinion clearly worse in every case (in the cases where I thought they were better or equivalent, I adopted your wording): hexagons are always two-dimensional; perimeter is a more complex synonym of edge which additionally implies measurement (which we don’t want to imply here); “the hexagons” and “hexagons” are effectively identical in meaning since precisely which hexagons are specified in the picture rather than the text; your substitution of “them” for “those” is unnecessary since the two have identical meaning in context, and I find “those” reads better, and similarly for changing my colon to a parenthetical, and swapping “instead of” for “rather than”; I believe that “mistakenly” makes this is a not-necessarily-correct statement (the usage of “saturation” is not especially well standardized, and so it could be argued that this use of saturation is not necessarily a “mistake” per se... it does deceive or mislead readers though, because it confuses what this article (and some of the earliest and most precise sources) calls "chroma" with HSL or HSV "saturation", and from context it is quite clearly not implying any malicious intent, which wouldn’t even make sense); in the fig. 14 caption my version is IMO clearer and more concise; re: fig 15, this was discussed above, and I suggest you try to get a consensus before changing this back (since it involves changes to images as well as to the article, meaning your revert only of the article text removes several explicitly referenced images – confusing to say the least); gamut is not the area of the plot, but is linked earlier to the article on gamut for readers unfamiliar with the term, and your “according to” here is unnecessarily verbose. Your “Further Reading” → “Further reading” change is proper, and I’ll put it back (I didn’t notice it before). –] ] 01:12, 8 July 2010 (UTC)

== unfinished discussions archived? ==

I don’t think setting a bot to archive all the discussions older than 3 months was/is a good idea, given that those discussions from March/April really weren’t close to a conclusion, and their subjects are still rather relevant. This page does not have enough editors/content turnover to justify the short archive time. –] ] 07:49, 11 July 2010 (UTC)

Revision as of 07:49, 11 July 2010

WikiProject iconColor B‑class High‑importance
WikiProject iconThis article is supported by WikiProject Color, a project that provides a central approach to color-related subjects on Misplaced Pages. Help us improve articles to good and 1.0 standards; visit the wikiproject page for more details.ColorWikipedia:WikiProject ColorTemplate:WikiProject Colorcolor
BThis article has been rated as B-class on Misplaced Pages's content assessment scale.
HighThis article has been rated as High-importance on the project's importance scale.
Peer review HSV color space has had a peer review by Misplaced Pages editors which is now archived. It may contain ideas you can use to improve this article.
Archiving icon
Archives


This page has archives. Sections older than 90 days may be automatically archived by Lowercase sigmabot III when more than 3 sections are present.


RGB -> HSV :: Hue transform error_HSV_::_Hue_transform_error-2010-06-17T06:21:00.000Z">

I see a mod6 in the image, I don't think it's supposed to be there. Instead, ma==rn -> (g-b)/c. Can someone double-check? —Preceding unsigned comment added by 74.105.42.220 (talk) 06:21, 17 June 2010 (UTC)_HSV_::_Hue_transform_error"> _HSV_::_Hue_transform_error">

The mod 6 is used so that the definition can be written piecewise in 3 parts (the part between -60° and 60°, the part between 60° and 180°, and the part between 180° and 240°), instead of 6 parts. Because hue is circular, -60° mod 360 = 240°. Does that make sense? –jacobolus (t) 23:07, 17 June 2010 (UTC)
The definition I currently see is
h'
 | C == 0    = 0
 | M == r    = ((g-b)/C) `mod` 6
 | M == g    = (b-r)/C + 2
 | M == b    = (r-g)/C + 4
h = 60 * h'
However I'm pretty sure it should be:
h'
 | C == 0    = 0
 | M == r    = (g-b)/C + 0
 | M == g    = (b-r)/C + 2
 | M == b    = (r-g)/C + 4
h
 | h' < 0    = 60 * (360 + h')
 | otherwise = 60 * h'
The way I visualize it, the chroma defines the size of the scaled cube/hexagon. Each side of this scaled hexagon is assigned a length of one. Each color is assigned a number counter-clockwise:
R  0
Y  1
G  2
C  3
B  4
M  5
The piecewise function is defined for each primary color and covers, like you wrote,
R  +60  <->  -60
G  +180 <->  +60
B  +300 <-> +180
The function gives the (maximum color) + (positive shift along circumference :: another color) + (negative shift along circumference :: last color). This is scaled to the size of new cube/hexagon defined by the chroma (explaining why the function divides by C). So for example, if Red is the maximum, then Green defines a postive shift along the circumference and Blue a negative (in the opposite direction).
Perhaps this is clearer:
h'
 | C == 0    = 0
 | M == r    = 120*(0/2) + 60*((g-b)/C)
 | M == g    = 120*(2/2) + 60*((b-r)/C)
 | M == b    = 120*(4/2) + 60*((r-g)/C)
h
 | h' < 0    = 60 * (360 + h')
 | otherwise = 60 * h'
One other clarification
"Thus if we add or subtract the same amount from all three of R, G, and B, we move vertically within our tilted cube, and do not change the projection"
Should be
"Thus if we add or subtract the same amount from all three of R, G, and B, we move vertically within our tilted cube, and do not change the hue or chroma (the value - a-axis - and saturation - are modifed)"
—Preceding unsigned comment added by 74.105.42.220 (talk) 02:52, 18 June 2010 (UTC)
The definition you are “pretty sure it should be” is not quite right, but the statement as I think you were trying to write it is mathematically identical to the current definition, just rewritten to be a bit longer and in my opinion less clear. Notice:
60 ( h mod 6 ) = ( 60 h ) mod 3 60 = { 360 + 60 h , if  h < 0 60 h otherwise {\displaystyle 60(h^{\prime }\;{\bmod {6}})=(60h^{\prime })\;{\bmod {3}}60={\begin{cases}360+60h^{\prime },&{\mbox{if }}h^{\prime }<0\\60h^{\prime }&{\mbox{otherwise}}\end{cases}}}
jacobolus (t) 22:34, 18 June 2010 (UTC)
huh good point, I wasn't aware of how modulus worked with negative numbers —74.105.42.220 (talk)
Yup, it works just the same on every interval. You can think of modulus as describing equivalence classes with representatives in a fixed interval. Each equivalence class includes all the points at distances which are even multiples of the interval length from the representative point (and therefore from each-other). When programming, the modulus operator is tremendously useful for normalizing angles to some desired range, because of course the reals modulo n are topologically equivalent to a circle. –jacobolus (t) 17:28, 22 June 2010 (UTC)
I don’t understand the point of your “other clarification”. –jacobolus (t) 22:34, 18 June 2010 (UTC)
Well technically it's a projection onto a hexagonal cone, which a vertical shift can modify.. but you were probably referring to the flattened projection onto the hexagon. —74.105.42.220 (talk)
The original point is in a “hexcone” (hexagonal pyramid). The projection is in a hexagon in the plane. The key insight for all the mathematical definitions used on this page – what keeps this math simpler and hopefully more comprehensible than the other definitions I’ve seen – is that we can keep “chroma” and “hue” constant (keep the same point in the projection) while moving “up” and “down”, and distort our cube into whatever “lightness”/“value” dimension we like. Later, we can find the point in the original cube by first finding the projection, and then adjusting the lightness/value (i.e. by adding equal amounts of R/G/B) to match our desired color. –jacobolus (t) 17:28, 22 June 2010 (UTC)

RGB -> HSV :: Clarification_HSV_::_Clarification-2010-06-17T06:30:00.000Z">

Which conversion method is more accurate? The piece-wise function definition over the hexagon, or trigonometric cartesian-polar transformation? —Preceding unsigned comment added by 74.105.42.220 (talk) 06:30, 17 June 2010 (UTC)_HSV_::_Clarification"> _HSV_::_Clarification">

It’s not clear what you mean by “accurate”. Those result in two different color spaces. Both of them are pretty awful as estimates of the perceived attributes “hue”, “saturation”, and “lightness”, but neither of the two is much better or worse than the other. Typically “HSL”/“HLS” implies the hexagon definition. –jacobolus (t) 23:07, 17 June 2010 (UTC)
By the way, if you have a specific purpose in implementing one of these models, I can probably give some advice if you explain the context. –jacobolus (t) 23:12, 17 June 2010 (UTC)
Thanks, I was implementing RGB<->HSV conversions and I wasn't sure if I should use the hexagon model or the circular model. —Preceding unsigned comment added by 74.105.42.220 (talk) 02:54, 18 June 2010 (UTC)
What are you planning to use it for, if you don’t mind my asking? –jacobolus (t) 06:26, 19 June 2010 (UTC)
As part of a bash script to modify the prompt (lol), the haskell program would chain several operations given an input color, including converting ansi<->web<->rgb<->hsv and/or lightening/darkening —Preceding unsigned comment added by 74.105.42.220 (talk) 05:35, 22 June 2010 (UTC)
If you decide to get a bit more ambitious, you’d get more human-relevant results by using a different color space than RGB or its derivative HSL/HSV (for example, CIELAB). Maybe for a simple tool though it’s not worth the effort. –jacobolus (t) 17:30, 22 June 2010 (UTC)

Saturation Calculations

In the image http://upload.wikimedia.org/math/4/0/b/40baec3ba585782daac778ead5d6a437.png used in the Saturation section, the first condition in both equations is unnecessary. Since C is the top value in each fraction, if C is 0 then the result will always be 0 without a special-case test for it. While this may be a programmatic shortcut, it adds nothing to the mathematical definition. GalacticCowboy (talk) 14:22, 23 June 2010 (UTC)

That condition is an easy way to guarantee that the result is defined when the denominator in the other equations could be zero. Dicklyon (talk) 03:46, 24 June 2010 (UTC)
As Dicklyon says, this is just the shortest way to write it. It could also be an explicit check for V = 0 in HSV, or for L = 0 or L = 1 in HSL. I think the way it’s currently written is also clearer and easier to understand (that is, the rationale) than the other versions. –jacobolus (t) 21:09, 24 June 2010 (UTC)

Image and image caption changes in use/history section

SharkD, I’m going to revert your image and caption changes. A few points:

0) I’d really like to at least hear a motivation along with such changes, perhaps on the talk page, if it won’t fit in edit summaries. Preferably it could be discussed first, since the prior version was fairly stable and there are several people actively interested in this article, but in general it’s also good to Be Bold, etc., so that’s okay.

1) You should make a new image if you want to cram a whole bunch of extra things in, instead of just adding stuff to the previous image; otherwise it’s confusing to discuss (can’t see both versions on a talk page, for example), and difficult to adjust/change/revert, because it requires altering image descriptions in multiple places, etc., and it’s impossible to effectively trace the history of the article, because the image shows something different than the prior version. If nothing else, I’d appreciate if you revert the image (& if applicable its description) and make a new one; if you don’t I will. (Also, the image filename no longer reflects the content.)

2) The previous image of color pickers compared and contrasted several color pickers. The article text, caption, and image description all made it extremely clear to readers what the image was about. The new version sticks different kinds of things into one image, and in general is much more confusing.

3) The color modification interfaces are now rendered so small that they are impossible to see, and thus essentially useless.

It’s off the subject, but are you ever planning to actually respond to the discussion from a few months ago about your 3-d rendered images?

jacobolus (t) 21:19, 24 June 2010 (UTC)

The image description should cover the scope of the image now. SharkD  Talk  10:39, 25 June 2010 (UTC)
Okay, since that’s pretty much a non-response, I’m going to revert your changes. –jacobolus (t) 17:49, 25 June 2010 (UTC)
I think the English in the image captions is poor, and needed revision for clarity. A lot of the image captions were poorly worded, and used poor grammar - for instance the usage of the "identifies" in the first image caption. The article said that performing some action "identifies" a particular shape or geometric object. Performing an action cannot "identify" anything. Things identify stuff, not actions. I also don't think that the images of color pickers and color adjustment tools need to be separated, or that the text in the section requires that they be handled individually. SharkD  Talk  18:18, 28 June 2010 (UTC)
Specifying the value of one coordinate identifies a particular cross-sectional slice. I don’t understand how that is confusing. The main reason that the color pickers and color adjustment tools need to be separated in my opinion is that the color adjustment tools are impossible to understand unless shown at a much larger size than the color pickers. The three color adjustment tool interfaces could probably be combined into one image, and then there would be 2 images overall, but I don’t really think it’s necessary.–jacobolus (t) 20:23, 28 June 2010 (UTC)
I disagree. That is improper use of the word "identifies", and the legibility issues WRT the images are not that great. They're perfectly legible if you click on them and view them in another window. In fact, the images are even more legible since the version I uploaded renders as twice the size by default. SharkD  Talk  02:06, 30 June 2010 (UTC)
Okay, well I think your rewrite of the "identifies" sentence is wordy and unclear. If it really must be different immediately, go ahead and put back the change to that one caption; either way, I can try to rewrite the whole caption tomorrow to avoid the word "identifies". Stop bulk reverting the rest though. As for the images, they are png screenshots, so I don't understand how they could render at twice the size on the image description page. But on the article page, your version renders much too small to be useful, and no, "just click it" is not an adequate response. Especially since there is plenty of room next to otherwise just big blocks of plain text to put color modification UI images with visible details. I don't understand what you mean by "legibility issues WRT the images are not that great". –jacobolus (t) 07:15, 30 June 2010 (UTC)
The images are no less legible than the color selection images. Are they really that important to the article? I don't think so. SharkD  Talk  18:02, 2 July 2010 (UTC)
The color selection images are useful to have in a consolidated image for a few reasons: (1) It demonstrates the relative sizes os the interfaces, which is relevant to understanding their differences, (2) The model being used and shape used for it is clearly visible at reduced dimensions, (3) The purpose is more high-level comparison than detail. The color-adjustment images, by contrast (and especially the one about xv), depend much more on the details. The purpose of including them is precisely the details. –jacobolus (t) 00:24, 3 July 2010 (UTC)

Dear SharkD, this edit war, and your unwillingness to discuss and edit in a cooperative manner, is pointless and tremendously frustrating. If you continue to revert/revert/revert, I will try to find a admin of some sort to temp-ban you. I hope you’ll stop so that step is unnecessary. –jacobolus (t) 00:24, 3 July 2010 (UTC)

In case you weren’t reading them, some of the last several edit summaries have gone like this:

SharkD: No, this wording is not good
jacobolus: listen, we can do the 3-step "be bold" (you), "revert" (me), "discuss". But rv/rv/rv/rv doesn't work
jacobolus: combine images into a table. does that help any?
SharkD: I just don't think the wording is any good.
jacobolus: rv. that's completely non-specific. I adopted several of your changes, rewrote parts of other captions again, changed around the image arrangement, etc.; you bulk reverted w/ one phrase of summary
SharkD: I still don't think it reads well
jacobolus: RV. Per 3RR, if for no other reason, PLEASE STOP the revert/revert/revert/revert. Go fix that particular "identifies" sentence if it’s urgent.
SharkD: I don't think the changes are good
jacobolus: RV: This is longer than 24 hours, so WP:3RR doesn't technically apply, but edit warring is really tedious, and I feel like you're not reading my edit summaries or the talk page. STOP.
jacobolus: remove "identifies" from this caption. SharkD, is that okay?
SharkD: I don't think this wording is any good.
jacobolus: RV. If you revert without discussion one more time I'll go find a moderator to temp-ban you. This is really getting obnoxious. Please stop.

Cheers, jacobolus (t) 00:33, 3 July 2010 (UTC)

I left this message at SharkD's talk page: Hey SharkD, I agree with you that some of the captions you have been reverting to your re-write aren’t ideally worded, and can use some work. I adopted several of your changes, but in other cases I think that your version either changes the meaning, or is wordier or less clear than the original. Instead of just reverting, I've been trying to make some compromises or further improvements, but if you just revert every one of my tries with a short and non-descriptive summary, we can’t really make any effective progress. I welcome your discussion at the talk page; I think we should be able to iron this out amicably and find text we can all agree on. That can only happen if you take part in the discussion though. –jacobolus (t) 05:35, 5 July 2010 (UTC)
Well, I don't think the wording of the English is very good. For instance, you say, "Below: two-dimensional plots showing two of a model’s three parameters at once, holding the other constant..." I don't think anything is being "held" here, or that someone is "holding" something. I'd think that "keeping" would be more in tune with what is going on. You also say that, "Such diagrams often claim to represent HSL or HSV directly, with the chroma dimension deceptively labeled “saturation”." Which sounds questionable to me, since "deceptively" sounds a lot like an accusation. You also say, "The definitions of hue and chroma in HSL and HSV have the effect of warping hexagons into circles." However, only some hexagons are being warped, not all hexagons everywhere. Thus it would be better to be specific. Maybe you would care to ask for a third opinion in these circumstances? SharkD  Talk  22:53, 7 July 2010 (UTC)
First, all of these are grammatical, and perfectly understandable in context. “Holding constant” is widespread usage (that is, is the idiomatic way to say this) in english-language math writing; see for instance this google search (or better perhaps this google scholar search) which provides many examples of such usage in context from a wide variety of fields and countless reliable sources. “Deceptively” implies that readers could be deceived (which is indeed what happens, we can see, because these usages are perpetuated). It is obvious from context (there is a diagram right next to the text) that the hexagons referenced are regular hexagons centered at the origin, in planes perpendicular to the central axis, and oriented so that one corner is at 0°. Writing all of that would be dramatically unnecessarily wordy. Second, your suggested alternatives are in my opinion clearly worse in every case (in the cases where I thought they were better or equivalent, I adopted your wording): hexagons are always two-dimensional; perimeter is a more complex synonym of edge which additionally implies measurement (which we don’t want to imply here); “the hexagons” and “hexagons” are effectively identical in meaning since precisely which hexagons are specified in the picture rather than the text; your substitution of “them” for “those” is unnecessary since the two have identical meaning in context, and I find “those” reads better, and similarly for changing my colon to a parenthetical, and swapping “instead of” for “rather than”; I believe that “mistakenly” makes this is a not-necessarily-correct statement (the usage of “saturation” is not especially well standardized, and so it could be argued that this use of saturation is not necessarily a “mistake” per se... it does deceive or mislead readers though, because it confuses what this article (and some of the earliest and most precise sources) calls "chroma" with HSL or HSV "saturation", and from context it is quite clearly not implying any malicious intent, which wouldn’t even make sense); in the fig. 14 caption my version is IMO clearer and more concise; re: fig 15, this was discussed above, and I suggest you try to get a consensus before changing this back (since it involves changes to images as well as to the article, meaning your revert only of the article text removes several explicitly referenced images – confusing to say the least); gamut is not the area of the plot, but is linked earlier to the article on gamut for readers unfamiliar with the term, and your “according to” here is unnecessarily verbose. Your “Further Reading” → “Further reading” change is proper, and I’ll put it back (I didn’t notice it before). –jacobolus (t) 01:12, 8 July 2010 (UTC)

unfinished discussions archived?

I don’t think setting a bot to archive all the discussions older than 3 months was/is a good idea, given that those discussions from March/April really weren’t close to a conclusion, and their subjects are still rather relevant. This page does not have enough editors/content turnover to justify the short archive time. –jacobolus (t) 07:49, 11 July 2010 (UTC)

Categories: