Jump to content

Saturation change bug.


circlularthinking

Recommended Posts

I have noticed a pretty major bug, if you make some red (255 red, no blue or green) and some blue (255 blue, no red or green) in an image.  (black background (probably not required), and some white (again, probably not required, but just ensuring it's absence wasn't causing issues as it can with curves and brightness contrast changes).

 

And then go into the hue and saturation changer and reduce the saturation to zero, the blue (now grey) becomes a LOT darker than the red!?!? (the blue becomes 'white' 29 while the red is ''white' 76?!)

 

If you rotate the hue of the image while in the colour changes, it make zero difference, but if you only rotate the hue, exit the changer and re-enter, then of course it makes a big difference to the colours you get.

 

 

I even tried using the colour channel change plugin so that the red and blue in an image could be swapped, but still the now blue portions are darker than the now red ones when saturation is taken to zero.

 

Incidentally Green when given the same treatment goes to 149!  So 29 blue .vs 149 green, when all were equally bright "fully on" before the change!?!?

 

It's the latest version of paint.net (overscroll version).

 

 

Link to comment
Share on other sites

I just made an image, I made some bars, after white and 127 grey there is Green, Red and Blue, with 50% saturated versions (I changed the S in the HSV of the colour pallet box to 50) next to each colour.

 

As reported and as you can see, the pure 255 green desaturates to 149, while the pure 255 blue desaturates to 29.

Meanwhile Yellow (255 red and green) desaturates to 225! And purple (255 red and blue) at the other extreme for these compound colours, desaturates to 105.

 

 

Plainly the Hue/Saturation tool is hugely broken!

 

Thanks,

John

saturation_change_errors_all_over_the_pl

As should be obvious, I selected and desaturated just the bottom half of the bars.

Edited by circlularthinking
Link to comment
Share on other sites

I'm pretty sure that the colors are intended to desaturate in a non-linear manner. I seem to recall that it is based on the apparent brightness/luminance.

 

Something like: Red *0.299 + Green*0.587 + Blue*0.114. Would that explain the difference?

Link to comment
Share on other sites

That's how the intensity is often defined when converting to black-and-white, and perhaps that's how PDN's built-in RGB to HSV routines calculate Value. That's not how I do it when I convert to and from HSV. I use (a scaled version of) the max of the RGB components. Microsoft's Color.GetBrightness method returns the average of the of the max and min components (which seems kind of weird). I wouldn't call it "a pretty major bug." HSV isn't built deeply into PDN. The plugins that use HSV do whatever they do.

 

EDIT: From what I can tell, PDN's built-in conversion routines use the same method I do, but the PixelOp routine that's used by the Hue/Saturation adjustment uses the weighted formula EER gave. Seems a little odd, but there may be a good reason.

Link to comment
Share on other sites

Byu major I mean the effect is large, if you make the brightest blue and then desaturate it it becomes 29, damn near black, but if you desaturate Yellow you get 225!

 

That is a difference of 196!  And sure, the compound colours at full brightness do look a bit brighter than RGB or B, but that's a huge difference.

 

I meant huge in that sense, not in the sense of of how deeply things are built into PDN, because I have no idea of that anyway.

 

But great, if this can be more easily fixed, that is brilliant!

 

Even if this is considered acceptable in some visual perception of photographs kind of way, I think the option to switch between that and a more consistent scheme across all colour channels would be a very good idea!

Link to comment
Share on other sites

Does it look like the relative brightness or darkness of the colours of these balls/balloons are plausibly reflected?

The light blue balloons are really dark Look at the super bright electric blue of the soccer ball transformed to a dark grey and the not so bright yellow transformed to a light grey, near white.

 

can_we_do_better.png

Link to comment
Share on other sites

My point about it not being a big deal was, it just affects a couple of effects: Hue/Saturation and Hue/Saturation+.

 

Maybe someone will write a plugin to adjust hue and saturation in a way you like better. My HSV Scrambler plugin will let you scale and offset the HSV values using the formula you (and I) prefer, though it's a bit overly complicated for what you want to do. If you use it, set the Saturation and Value Bounds Handling to Clamp rather than Reflected Wrap.

Link to comment
Share on other sites

Well, I actually think the B&W color conversion for the balls is fairly decent. I can say for sure it's better than what you'd get if you just set the saturation to 0. Setting the saturation to zero is not a good way to convert to B&W.

Link to comment
Share on other sites

a_bit_different.png

Ok, try this. A dark blue background with a medium bright yellow circle, bottom half desaturated makes the background almost black and the ball a light grey

 

On the other image to the right I have rotated the hue 180, this gives a dark yellow bronze background and a decently bright blue ball, desaturated the ball becomes almost indistinguishable from black and the much darker background is a lot lighter than the ball.

 

It looks like a negative.

 

BTW I tested the black and white function and it gives the same result.  I'll try and use your plugin and see if that can be used.

Edited by circlularthinking
Link to comment
Share on other sites

Brightish blue circle on dark yellow background, the hue has been rotated 180 degrees for the bottom half and then the whole thing desaturated.

 

I would/could have expected the top and bottom halves of this to be identical or at least nearly so, clearly it the bottom looks nearer to being a negative of the top.

almost_a_negative.png

Edited by circlularthinking
Link to comment
Share on other sites

If your goal is converting to Black and White, I doubt my HSV Scrambler plugin does what you want. As I said in an earlier comment, setting the saturation to 0 is not a good way to convert to B&W.

Link to comment
Share on other sites

Brightish blue circle on dark yellow background, the hue has been rotated 180 degrees for the bottom half and then the whole thing desaturated.

 

I would have expected the top and bottom halves of this to be identical, clearly it the bottom looks nearer to being a negative of the top.

almost_a_negative.png

 

I wouldn't at all. That's not how photographs work, and it's not how the eye works. Fully saturated yellow is brighter than fully saturated blue.

 

(I do agree that the blue circle on the dark, desaturated yellow background doesn't look correct.)

Link to comment
Share on other sites

Does it look like the relative brightness or darkness of the colours of these balls/balloons are plausibly reflected?

The light blue balloons are really dark Look at the super bright electric blue of the soccer ball transformed to a dark grey and the not so bright yellow transformed to a light grey, near white.

 

can_we_do_better.png

To me, these conversions to B&W look fine. I think MOST users would agree.

If you don't, there is a simple fix: write a plugin to do the conversion you want.

That is the beauty of paint.net, it has a rich plugin system... and tons of resources to help you if you get stuck.

In fact, give me the formula you want to use to convert from color RGB to B&W* and I'll write you a plugin.

*something similar to this:

Red *0.299 + Green*0.587 + Blue*0.114

Link to comment
Share on other sites

Here is a little plugin, called Adjustments>Black and White+, that I just wrote. It lets you specify the weights for R, G, and B. It's nothing fancy, but I'll probably officially release it.

 

Here is the DLL: BlackAndWhite+.zip

  • Upvote 1
Link to comment
Share on other sites

Boltbait, I was about to take you up on your offer, then I found a way to do this with the RGB remap plugin I just began using.

 

If I set the colour on all channels to white (left slider all the way down) and set the R, G & B to 84 and untick normalize it makes red, green and blue all black and white to the same shade.

 

The mixed colours Y, C & M will be brighter, but that's ok since they look brighter and are brighter.

 

If you still want to make a plugin, to make it maximumly versatile, the value of white/grey that full Y, C & M should turn into could be set, with a separate setting for R, G & B.  Obviously also it would be handy if the desaturation could be partial or complete, but if not that could be achieved with some layer mixing between the 2 versions I think.

 

Values less that full (would naturally be mapped of a straight slope naturally.

 

I'll show the results of RGB remap plugin in a subsequent post.

Link to comment
Share on other sites

Here is a little plugin, called Adjustments>Black and White+, that I just wrote. It lets you specify the weights for R, G, and B. It's nothing fancy, but I'll probably officially release it.

 

Here is the DLL: attachicon.gifBlackAndWhite+.zip

MJW, thanks a lot. I have used this a number of times now and it is very helpful when changing coloured images (line art) into black and white

 

In such cases having the blue become a virtual black is not desired.

Link to comment
Share on other sites

You're certainly welcome. I'm happy it was useful. I have a newer version, with a couple of minor added features, which I'll release in a few days.

  • Upvote 1
Link to comment
Share on other sites

MJW, it's not really needed for my work, but I was thinking that an ideal one would have settings for CMY as well as RGB so it acted as a continuum, so that a given brightness of any hue could (if adjusted so all were at the same value) go to the same value of white/grey.

 

So if you applied this to the colour wheel, instead of 3 bright patches with the cross over colours C, M & Y, it would be the same all around, or by setting the CMY differently to the RGB it could be accentuated or de-emphasized the effect of mixed colours.

 

But I have no idea how hard this would be to do as it will impact every shade of colour mix differently.  So please ignore this idea if not easy (or either way).

Link to comment
Share on other sites

That's an interesting idea for a plugin, and perhaps I'll write one that does that, but it would most likely be a separate plugin, since the the way it worked would need to be quite different than simply summing the weighted RGB components.

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...