Jump to content

HSL instead of HSV?


Recommended Posts

Hey there. I'm a big fan of the HSL model (hue saturation lightness) as opposed to the HSV (hue saturation value) model. I'm gonna be teaching a person to use paint.net and I find HSV kinda hard to explain. I also find it easier to explain how to create color schemes if one thinks in HSL terms.

I was wondering if there are plans to include this model in the color dialog or to include an option to change it. If not, would a patch be welcome to add this option, I really would like this and it would be trivial to do.

Cheers!

Link to comment
Share on other sites

Ok, that wording is not going to win you any friends around here. :D

I'll let Rick speak for himself, but I very seriously doubt he'll be changing from HSV to HSL in Paint.NET.

Hey, I was offering a patch. I'm a coder. And I know that's a bad thing to say, I contribute to open source projects myself. I wouldn't say it if I wasn't offering to do it.

Also I'm not talking about removing HSV, just adding an option to change it to HSL.

And for those asking "Some advantages of HSL are that it is symmetrical to lightness and darkness (which is not the case with HSV for example)" from http://www.w3.org/TR/css3-color/ . But in general it's just that it's just simpler. Also, since windows uses it in the standard color picker dialog, some people are used to it (like me).

But ok, never mind then.

Cheers.

Edited by Faral
Link to comment
Share on other sites

  • 2 weeks later...

So in the end I made this for myself on the latest available source code.

RXX4k.png

I could add a switch to let users select HSL or HSV.

I offer again cause Rick said "Nope" and I don't know if he meant that he didn't plan to do it or that he didn't want a patch or both. I figure it's the latter but I thought I'd ask just in case. I'm gonna be using this myself if it isn' wanted, with the downside of being stuck to an old version.

Cheers.

Edited by Faral
Link to comment
Share on other sites

You're fine to use that for yourself, but you can't distribute it to others.

Yeah no worries, this is something I did for myself because I'm used to HSL, I was just offering a patch.

Also, this is based on 3.36 which is MIT licensed, so I could share if I wanted, right? Just curious.

Cheers.

Link to comment
Share on other sites

You can't distribute it for trademark/copyright reasons either. Paint.NET is a registered trademark. Just because you have the source code doesn't mean you can start distributing your own version of things. (I'm referring to binaries. You can, of course, share around the code changes you made. Just not here on the forum.)

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

You can't distribute it for trademark/copyright reasons either. Paint.NET is a registered trademark.

Well, if I wanted to redistribute this it wouldn't be called Paint.NET obviously.

Just because you have the source code doesn't mean you can start distributing your own version of things. (I'm referring to binaries. You can, of course, share around the code changes you made. Just not here on the forum.)

I don't understand the part about not being able to distribute binaries. I can take the MIT licensed code of 3.36, build it, name it something else and redistribute it (not on your forum of course) as long as I keep your copyright information, correct?

I'm not planning on doing this, I was just offering you a patch, but since you brought it up I would like to understand it. I like to think that I understand open source licenses and this confuses me a tad.

Edited by Faral
Link to comment
Share on other sites

Paint.NET isn't open source.

 

The Doctor: There was a goblin, or a trickster, or a warrior... A nameless, terrible thing, soaked in the blood of a billion galaxies. The most feared being in all the cosmos. And nothing could stop it, or hold it, or reason with it. One day it would just drop out of the sky and tear down your world.
Amy: But how did it end up in there?
The Doctor: You know fairy tales. A good wizard tricked it.
River Song: I hate good wizards in fairy tales; they always turn out to be him.

Link to comment
Share on other sites

Also I'm not talking about removing HSV, just adding an option to change it to HSL.

A nobel idea, but having an option is actually much more costly and complicated than having only one! I'm generally not a fan of having many options, as you may have seen. I try to design and engineer Paint.NET so that things are homogenous as possible across different people's systems. It just makes things so much easier for everyone, and saves a lot of time for me so that I can focus on new features and things (I'm just one guy!). As you may have noticed, the code for ColorsForm is very delicate, and I'm wary of making changes to it. It's 5,000 lines of code that works because it's been tested and fixed over 7 years. If I were to write it now it would probably be much more robust and of higher quality (I'd probably use WPF data binding), but that is not the case and there isn't a compelling reason at this time (e.g., for v4.0) to do this (in other words, what features would it enable? are those features important?).

I don't understand the part about not being able to distribute binaries. I can take the MIT licensed code of 3.36, build it, name it something else and redistribute it (not on your forum of course) as long as I keep your copyright information, correct?

Technically this is correct for the most part, although I ask that you don't do this. Paint.NET clones have been a major pain in my side for various reasons (both fair and unfair, legal and illegal). Other than that, however, you risk other problems, especially due to the auto-updater stuff. And GPC, which is used in Paint.NET v3.36 and whose licensing terms are another matter to deal with. In general, unless you're willing to spend a lot of your resources and time on this, I honestly don't think it'd be worth it for you. "Open source" has a colloquial meaning across the Internet, but just because something is "open source" doesn't mean it gives you all the permissions that other "open source" projects have. It's much more complex than that. (I've often called Paint.NET v3.36 and before "released source.") Releasing a patch or diff (or whatever the right term is) would be perfectly fine and a good way to start.

Here's what I'd recommend. It looks like the Pinta project, which is an open-source clone of Paint.NET v3.36, has started back up. You may have good success pushing through your ideas and code into that project, and you'd have their support and development community to work with. If the changes are really really worthwile, I would consider adopting them into Paint.NET (not that I'd copy the code, but rather I'd incorporate the ideas). Right now I'm not convinced it's the case, although not because I think your changes are bad or anything. For a change like this I would need evidence that it has a clear benefit to many users. And even then, it has to be weighed against the priorities and importance of all the other work items for v4.0 (like, say, shapes and brushes, adjustment layers, antialiased selections, etc. etc. ... the list goes on almost forever!).

One thing I haven't really asked you yet, however, is what is the big difference between HSV and HSL? I'm not asking to be snarky -- I just am not familiar with the differences. Is 'V' just the inverse of 'L', or are they non-overlapping color spaces? I'm not sure what the advantage could possibly be for having HSL vs. HSV, especially since Paint.NET doesn't really truly "support" HSV in the first place (it's a mathematical convenience).

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

Thanks for the explanations. I figured you wouldn't be interested in cluttering the interface for this, it's ok, I was just offering just in case.

One thing I haven't really asked you yet, however, is what is the big difference between HSV and HSL? I'm not asking to be snarky -- I just am not familiar with the differences. Is 'V' just the inverse of 'L', or are they non-overlapping color spaces? I'm not sure what the advantage could possibly be for having HSL vs. HSV, especially since Paint.NET doesn't really truly "support" HSV in the first place (it's a mathematical convenience).

While 0% value is black and 100% value is a saturated color. 0% lightness is black and 100% lightness is white, with 50% being a saturated color. The advantage for me is that it maps closer to the way I come up with of colors. It's almost the same though, so it's no biggie, just a matter of preference, I wouldn't say that HSL is superior to HSV or anything like that, maybe there are some advantages to HSV I'm missing.

Cheers.

Link to comment
Share on other sites

  • 6 years later...

The main difference between HSL and HSV is that HSL enables more control over tinted areas.  That's pretty much it.

 

Hsl-hsv_models_b.svg

 

 

That to show how they compare.

G'MIC Filter Developer

 

I am away from this forum for undetermined amount of time: If you really need anything related to my PDN plugin or my G'MIC filter within G'MIC plugin, then you can contact me via Paint.NET discord, and mention me.

Link to comment
Share on other sites

1 hour ago, Reptillian said:

The main difference between HSL and HSV is that HSL enables more control over tinted areas.  That's pretty much it.

 

Hsl-hsv_models_b.svg

 

That makes sense. So what's to stop you (or anyone interested) from fine tuning via opacity slider to get the same effect? 

1 hour ago, Reptillian said:

 

That to show how they compare.

 

Edited by dipstick

69unju0.gif

Link to comment
Share on other sites

2 hours ago, Reptillian said:

The main difference between HSL and HSV is that HSL enables more control over tinted areas.  That's pretty much it.

The main difference is that Saturation and Lightness of HSL are more intuitive and easy to handle than Saturation and Value of HSV.

"The HSL model attempts to resemble more perceptual color models ..." (as Wikipedia says)

 

I have a pretty good intuition which slider and where should I drag in case of HSL.

Lightness for amount of light, Saturation for how "clean" the color is.

Normally I need either make color more clean or grayed while keeping brightness, or adjust brightness up or down in wide range without affecting "cleanliness".

HSV has these features entangled - no way to achieve the result without twiddling with both sliders.

 

Link to comment
Share on other sites

  • 4 years later...

I have been messing around with the dialog for "Adjustments" → "Hue / Saturation", and was curious whether it uses HSL/HSB/HSV. Didn't realize it was such a rabbit hole! 

 

According to ImageMagick when adjusting HSL hue-saturation-lightness or HSB/HSV hue-saturation-brightness/value, "For some images you are damned if you use HSL, and for other images you are damned if you use HSB colorspace. It just depends on what you are attempting to do!" https://www.imagemagick.org/Usage/color_mods/#modulate_colorspace

 

It further explains, "In HSL ... when brightness is then reduced the off-white colors get expanded... That is, small variations in color are exaggerated" and "[In] HSB ... if you brighten an image ... the colors become more saturated, and bolder, rather than the image becoming more brilliant and whiter."

 

So it seems HSL is useful when brightening images, and HSB when darkening images, but I may be oversimplifying not sure.

 

And yet when I try magick -modulate 160,50,100 in either HSL or HSB, I get different results from the Paint.NET dialogue choosing Lightness=60, Saturation=50, and Hue=0. Very interesting, I wonder what's going on.

 

EDIT okay I tried magick -modulate 1000000,100,100, and I see what's going on. Paint.NET's brightness/lightness changes affect pure black, but ImageMagick's do not. There's completely different math going on behind the scenes. I prefer what I get from Paint.NET, but not sure how to script it to automatically apply 50% brighter + 50% less saturation to dozens of images.

Edited by nuk
typo
Link to comment
Share on other sites

OK with some external help I was able to exactly replicate Paint.NET's effect with this in ImageMagick! Note the mathematical values conveniently correspond between ImageMagick and Paint.NET, with (1-0.4) and 160% for brightness, and 0.5 and 50% for saturation, respectively.
 

magick.exe .\sample.png -channel RGB -negate -evaluate Multiply 0.4 -negate  +channel -colorspace HSL -channel 1 -evaluate Multiply 0.5 +channel x.png

 

Further explanation at https://github.com/ImageMagick/ImageMagick/discussions/6357

Link to comment
Share on other sites

  • 2 months later...

I will add into this topic, the fact that raw values are measured in HSV while colour adjustments are done in HSL. This makes it quite a nightmare to do colour calculations. Often times, we do colour adjustments based on relative. Without having to rely on external tools, this is not a possible process. And those external tools are needless hoops for a colourist or raster editor to go through.

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.

×
×
  • Create New...