PDA

View Full Version : Conceptually Designing HSL Algorithm



simpleid
11-20-2007, 10:28 AM
edit: nvm

brewbuck
11-20-2007, 12:43 PM
The relationship between HSV and RGB is defined. If you implement it any other way, you are no longer dealing with HSV, but some weird "simpleid space." If you somehow come up with a mathematical expression that gives the same results in all cases, then good for you, but it's not going to be anywhere near as efficient as the typical method.

HSV is a defined concept, not an observed one, because it is based on human perception. We perceive the violet end of the spectrum to "wrap around" back onto the red end. But this is a psychological phenomenon, not a physical one. There is nothing in the universe that would indicate HSV as a "natural" way of representing color values. So if you diverge from what is defined, you are no longer working with HSV.

EDIT: In other words, HSV is NOT some ugly-looking approximation of some beautiful underlying concept. It IS the concept.

simpleid
11-20-2007, 02:16 PM
edit: nvm

brewbuck
11-20-2007, 04:25 PM
i am in fact trying to redefine it.

that's the point. i specifically mentioned 'i simply don't like it', not 'it's not defined by the laws of nature' and i didn't say that i was going to define it as such, that i did only want a solution that 'felt more natural' despite the fact that it isn't

The HSV solution is completely elegant. The math appears unintuitive because it is the end result of a few very elegant looking diagrams. The Hue_to_RGB() function is just switching between a few linear functions depending on the actual value of hue.


i also didn't want to debate something trivial, just wanted to spark a discussion on finding a relationship between what does exist and something more potentially interesting.

i was just making an art of it. i thought some people might enjoy that.

The design of the HSV space is already pretty cool. Please, try reading a little more about it instead of just staring at the equations.


but specifically i was asking help on an aspect of redefining it, so if you can contribute then do, please. otherwise making any arguments against my little venture will be futile so you might as well end it with that. :-P

Well, to address your questions on saturation, consider the variance in the differences from the mean of R, G, B, in other words, this value:



double square(double x) { return x * x; }

double mean = (R + G + B) / 3.0;
double variance = square(R - mean) + square(G - mean) + square(B - mean);


But that's not really good enough, because it assigns different values to (128, 64, 32) and (64, 32, 16) when these values obviously only differ in intensity, not saturation. There is an adjustment you can make to eliminate this difference, think about what it is.

Also, are your RGB values calibrated to the human eye, or are you using absolute intensities? Or are you using some form of gamma? This stuff all matters too.

DavidP
11-20-2007, 04:27 PM
Forgive me if I am wrong (I have only been looking at your sample image for about a minute now), but it seems like there is some flaw in your logic.

Let's take your image:

7651

Now, according to my understanding of how you explained it, if we take that blue vertical line that you drew in the image, and we slide it horizontally to the right, we can take a sample of the RGB values at that corresponding "h" value. In other words, at some value "x" along the X-axis, the values of the 3 sine waves at that "x" position will be our RGB values.

The fundamental problem is the simple fact that under your example, you can never have "black" or "white" (RGB = 0 0 0 or RGB = 255 255 255), because there is never a moment in all of infinity when all 3 sine waves will all reach a trough or crest. So you cannot represent all colors.

That's my observation....but sorry if I am wrong. I am not well versed on the subject of HSL/HSV.

simpleid
11-20-2007, 04:42 PM
edit: nvm

brewbuck
11-20-2007, 05:08 PM
i have done my research, and have found other implementations which encompass trig functions to come up with solutions. ;-)

Well yes, mapping an inherently polar space to a linear one is going to involve trig. That doesn't have anything to do with waves though.


i'm just working on my own, for an intellectual exercise. the point is, i want to *realize* a solution by *myself*. i already told you, you can't convince me to stop, so either aid in the discussion or ignore it. thanks!

I'm not convincing you to stop what you're doing. You asked for a discussion and you seem to want to exclude my opinion specifically. Okay...


i feel that if i can discover new ways to achieve the same effect, then i am doing something worth while. for that reason i prefer to keep doing these things, so that my software can be truly unique. :-)

I was trying to play along by bringing up a potential method for defining "saturation."

VirtualAce
11-20-2007, 06:13 PM
Color spaces and the math behind them are very well documented, defined, and proven. Anything else is reinventing the wheel.

simpleid
11-20-2007, 07:06 PM
edit: nvm

brewbuck
11-20-2007, 07:12 PM
Okay, I give up. I have no idea what this thread is about. Are we supposed to bow down to your independent spirit or something? Anything actually on the topic of color spaces seems to get shot down.

simpleid
11-20-2007, 07:22 PM
don't be such an .............., my request for help was very clear

i couldn't think of a way to incorporate saturation in to the way i was
trying to figure this out.

you didn't have to say half of what you did, and i was only rightfully defending
the purpose of my post. which was meaningless for you to question.

the only thing that mattered was i was looking for some thoughts, just offering
thoughts on incorporating saturation would have been PLENTY.

and now for all of this you'll turn it on me to make me look like some kind of arrogant
ass when it was only my intent to justify.

i wish a mod would just lock this or delete it.

brewbuck
11-20-2007, 07:50 PM
don't be such an .............., my request for help was very clear

No, you were droning on and on about how "artistic" you are, made some vague request for ideas, then stomped on everybody who decided to respond.


i couldn't think of a way to incorporate saturation in to the way i was
trying to figure this out.

Possibly because the entire idea is bogus. I tried to provide a fresh idea about saturation, you are still completely ignoring it, probably because you don't understand it.


you didn't have to say half of what you did, and i was only rightfully defending
the purpose of my post. which was meaningless for you to question.

You are a crackpot.


the only thing that mattered was i was looking for some thoughts, just offering
thoughts on incorporating saturation would have been PLENTY.

I did. You're too busy foaming at the mouth over the fact that somebody out there might be smarter than you, to notice it.


and now for all of this you'll turn it on me to make me look like some kind of arrogant ass when it was only my intent to justify.

First you say it's just an intellectual exercise, which requires no justification. Then you try to justify it. Make up your mind.


i wish a mod would just lock this or delete it.

I'm willing to discuss the original topic if you're willing to LISTEN.

VirtualAce
11-20-2007, 11:57 PM
I think this thread has derailed significantly.