What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

How to create a Saturation mask?


Thonord

Member
Messages
20
Likes
6
Tom Mann

Not far north at all, South of Oslo, so no pictures of the aurora. We do see it here, during winter, but it is NOTHING like up north.

Thanks for the links.
 
Last edited:

Tom Mann

Guru
Messages
7,223
Likes
4,343
...ACR: I have been working under the "do as little damage as possible" in ACR....

Actually, you want to make as many of the major changes in ACR as possible, leaving all the smaller tweaks for Photoshop proper. The reason for this is that if you are indeed working with a raw data file, it's bit depth and all processing is done at either 12 or 14 bits per channel (bpc), whereas once you export the file from ACR to Photoshop, the maximum bit depth you can use (...ignoring 32 bit files for HDR work) is 16 bpc. So, the the probability of banding and other artifacts related to quantization of the image into discrete levels is greatly reduced.

...because I don't quite understand the " pixel Saturation = Maximum (R,G,B) - Minimum (R,G,B)". Which maximum pixel - what minimum pixel? ..
To be honest, the only time I've seen that formula has been with respect to chroma, not saturation, but I'll have to think about the relation between the two. However, I can explain in words what it means: The first term in that formula tells one that for any particular pixel in an image, find the largest of R, G, and B and write it down. Then, for the same pixel, find the smallest of R, G, and B for that same pixel and write that down. The difference between the two numbers is the chroma / saturation for that particular pixel.

HTH,

Tom M
 
Last edited:

Tom Mann

Guru
Messages
7,223
Likes
4,343
...Not far north at all, South of Oslo, so no pictures of the aurora. We do see it here, during winter, but it is NOTHING like up north. ...
Ahh, but I'm sure it's much nicer where you live than here on the east coast of the USA. The furthest north I've ever been is northern Iceland, but that was only during the summer, so the probability of seeing northern lights was next to zero. Unfortunately, even though my wife is of Swedish descent, she is not a cold weather person so I can't get her to go up there in winter, LOL.

Cheers,

Tom M
 

Thonord

Member
Messages
20
Likes
6
Then, for the same pixel, find the smallest of R, G, and B for that same pixel and write that down. The difference between the two numbers is the chroma / saturation for that particular pixel.

HTH,

Tom M

I may have misunderstood, but how can a single pixel have different values?
 

Tom Mann

Guru
Messages
7,223
Likes
4,343
As an example, pixel #1 has R=50, G=100, and B=150. The maximum of these three numbers is 150. The minimum of these three numbers is 50, so the chroma is 100.

As a second example, pixel #2 has R=100, G=100, and B=100. The maximum of these three numbers is 100, and the minimum of them also equals 100, so the chroma is 0 (ie, it's completely unsaturated, a gray pixel or middle brightness)

HTH,

Tom M
 

thebestcpu

Guru
Messages
2,979
Likes
2,737
Thanks for jumping in Tom. I think you have covered in more detail (in English instead of math) how the Saturation version from Saturation Blend is calculated. In summary

1) Take a any single pixel
2) Take the Maximum numeric value among the Red value, Green value and Blue value of the pixel
3) Using the same pixel take the Minimum numeric value among the Red value, Green value and Blue value
4) Subtract the Minimum value found in #3 from the Maximum value found in #2 and that is the Saturation value for the selected pixel location
5) Repeat #1 thru #4 for all pixels of the image and you have the Saturation Layer


While we are at it, I just wanted to disabuse anyone about this being the "simple" answer or rote procedure for saturation with the following 4 points:

1) When using the Saturation blend mode on a given Layer, PS is "trying" to take the Saturation Value as defined above for that Layer and combine it with the Hue and Luminosity from the visible Layers below. It is not quite so clean because not all values of Luminosity and Saturation can co-exist e.g. an RGB pixel of 255, 255, 255 or maximum luminosity also has zero saturation. When a Saturation Blend with a pixel of non-zero Saturation value from that Layer, tries to combine that with a maximum luminosity value from the lower levels, it must chose which one has priority since one of those values must give. Turns out that the Saturation Blend mode gives Luminosity priority over Saturation. In the final blend, Saturation is not necessarily maintained in the upper Layer and Saturation may be reduced if needed to preserve the Luminosity values from below. (note there is no conflict in holding the Hue from the lower levels).

2) The absolute Saturation Level value for a given visual color, depends on the Color Space the image is in. Wider gamut color spaces represent the same visual color with smaller RGB numbers. The absolute numeric Saturation will be smaller when using wider gamut color spaces. So a given fixed procedure will have somewhat different results in different color spaces.

3) If you monitor cannot represent the full gamut of the Color Space being used, you may have colors with different saturation mapped to the same visual saturation (due to limited color gamut).

4) There are multiple ways to create a Layer Mask and PS is not consistent in the numeric values that end up in the Layer Mask. The reason being is through some paths, the Layer Mask values are dependent on the default Gray Working Space in Edit > Color Settings. Yes, through some Layer Mask Creation steps the values go through a Color Space to Gray space transformation (details not included)

The reason that I mention the above steps is that numeric consistency has its limits here yet all that changes is that the Layer Mask will be relatively the same, maybe just brighter or darker and you have to make bigger adjustments with Adjustment Layer Sliders to compensate. You can get to the same result in spite of the above factors and just adjust to taste as opposed to expecting a rote procedure to give the same exact result.
 

Thonord

Member
Messages
20
Likes
6
Thanks again:) You guys are good!

Tom, I thought that maximum saturation would be White (255,255,255), which it is NOT. Not only do I know it now, but I'm getting close to understanding it.

thebestcpu,
I really need to digest this. I was afraid an understanding of color space was necessary. In my simple world aRGB was for Photoshop, sRGB was for monitors and CMYK for print. I have heard of "out of gamut" and blamed it for my poor prints.

I need to call a Time Out!

I'm not going away, but need to seriously educate myself, and I promise to do so at the best of my ability, but it will take some time. I have a book by Dan Margulis "Professional Photoshop 5, The classic guide to color correction" I have put aside. It is now at the top of my ToDo list. It turned out to be way over my head, but now I will view it differently.
 

thebestcpu

Guru
Messages
2,979
Likes
2,737
Hi Thonord

Learning is just a work in progress for all of us. We are just at different stages. No need to go away as part of learning is asking questions as you go. I did not mean to scare you off with my last post. That was really to be complete not for you, yet for others that might be more deeply into the details (these forums have a wide variety of needs and interests).

A lot of PS besides learning is trying things out and sticking with the ones that work for you. So learn as you go. As long as you get the end artistic objective, the details really don't matter.

There were two different areas that you mentioned. One was about color management and the other was about color correction. For some easier reading on Color Management, Color Spaces, and translating between spaces, here is a link to the first of a 3 part article on those very topics (links at bottom of first article to the remaining two articles): http://www.cambridgeincolour.com/tutorials/color-management1.htm

No need to become an expert, just getting a working knowledge is often more than enough. These 3 connected articles might just enough to get going for you. Hope they help.
 

Tom Mann

Guru
Messages
7,223
Likes
4,343
John, a quick question for you ... I wanted to play around with all four combinations of "tagged" and "profile embedded" sRGB files, ie,
1) not tagged, no embedded profile
2) tagged, but no embedded profile
3) not tagged, but has an embedded profile
4) tagged, and has an embedded profile

I assumed all the above four versions of a file would be easy to generate in PS, but when I did some experiments using "save for web", and examined the metadata using EXIF tool GUI, for some reason (maybe tiredness, LOL), I could only generate #1 and #4. I was able to generate #2 using XnView, and haven't yet bothered playing around with #3.

What's your favorite way to generate test cases like this? For example, do you go right to the heart of the matter and edit the metadata directly using something like EXIFtool?

Cheers,

Tom M
 

thebestcpu

Guru
Messages
2,979
Likes
2,737
Sorry Tom, I have not explored those areas. I usually only explore to those types of depths if a needs arises. When that occurs I have used anything from Hex Editors to EXIFtool.

While I know the detailed specifications/standards go well beyond common understandings including the combinations you list (#1 thru #4). I also know that not all developers strictly adhere to all of the standards so sometimes it is hard to draw conclusions about what is the "standard" expectation of such nuances vs it is just a behavior from a specific developer (I call those bugs).

For my purposes, I interchangeably use the terms "imaged tagged with a color profile" and "image with an embedded profile." Some experts in the field use them interchangeably as well.

For sharing and explanations I simplify to having "color numbers" and "color scales" (aka color space or ICC profile) associated with the color numbers. If an application can determine from the image file, the "color scale" associated with the "color data", then I interchangeably use the terms that that the profile is tagged or embedded with the image.

Likewise, if an application cannot determine from the image file, the "color scale" associated with the "color data", then I interchangeably use the terms that the profile is not tagged or not embedded with the image.

While that may not be in the absolute limits technically accurate, from the standpoint of PS users I believe it is most likely sufficient and most color management books targeted at photographers and PS users don't go any deeper than that either.

I am already too prone to provide too much technical details in my posts (my affliction) and that can scare people off which is not good (though I am tempted often).

As an analogy: for those that eat meat and love sausage, you never, never, ever what to show them how it is made. :rolleyes:

On the other hand, if you find out something interesting, please let me know the results :)
 

Thonord

Member
Messages
20
Likes
6
Hmm, I have just completed an eloquent, humorous, sharp witted, yet poignant reply. and I must have forgotten to hit "Post Quick Reply"! .
So, you'r are stuck with the short version.


thebestcpu: Quote: No need to go away as part of learning is asking questions as you go. I did not mean to scare you off with my last post.


Hehe, I'm not going away. I'm just going somewhere I can give my brain a vacation. I have just the spot!


And you are not scaring me away! I am intrigued, my desire for knowledge is whetted:)!


And not to forget! your saturation action. Been playing a lot with it - all 32 steps:) and it works really very good! But I have one question: I keeps telling me "it can't Fill" Well - it fills just fine - although I don't know why you chose Blue. And I get a saturation mask - I can use to target exactly what I want by intersecting - and sometimes inverting. Thank you!.
 

thebestcpu

Guru
Messages
2,979
Likes
2,737
Hehe, I'm not going away. I'm just going somewhere I can give my brain a vacation. I have just the spot!

And you are not scaring me away! I am intrigued, my desire for knowledge is whetted:)!

And not to forget! your saturation action. Been playing a lot with it - all 32 steps:) and it works really very good! But I have one question: I keeps telling me "it can't Fill" Well - it fills just fine - although I don't know why you chose Blue. And I get a saturation mask - I can use to target exactly what I want by intersecting - and sometimes inverting. Thank you!.

You're welcome about the Saturation Action

Glad you're not going away. Sometimes I just put in more detail that is needed or appropriate (or of interest). I try to catch myself doing that yet being concise is not one of my strong suits.

Not sure why you are getting the error message. Since I made that Action up on the fly, it certainly could have a bug. I do know that PS complains when a selection does not cross the 50% point. You can always Private Message me through this site with more details on which specific steps cause the issue and I can take a look at it. I don't get the error message on my side yet it may be image dependent.

As far as picking the Blue Layer: Actually the Action can be modified at a few steps to use solid Green or solid Red for that Layer as well. With a little more work it could be done with the solid Secondary Colors as well (Yellow, Cyan, or Magenta). All that is being done is a process to "tickle" out the Saturation value. Here I go again with some details :cry::

- Remember that the Saturation Blend is applied to the image Layer so the Saturation component of the image is used while the Hue and Luminosity components are pulled from the lower solid primary color Layer below.
- I use a solid Primary Color so that the resulting Saturation value will end up isolated in a single color channel (i.e that channel of that primary color)
- I use the maximum value for that solid color because is the "only" Luminosity Value for the Primary Color that will not interfere with the Saturation Value pulled from the image (Remember in a detail of a prior post, I noted that in a Saturation Blend, Luminosity trumps Saturation in the result. So for this process to work and not have Luminosity trump the Saturation value in the image, the lower layer had to be a fully saturated and a single Hue for the result to show up in a single channel.
- So going back to my specific Action where I use solid Blue, when the Saturation Blend is performed, the Blue Channel ends up with the Saturation Value, uplifted/encoded by the Value in the Red or Green Channel (their identical to hold the Blue Hue). That uplifting/encoding is how the Luminosity is included in the Saturation Blend.
- So all I have to do is subtract either the Red or Green channel value from the Blue channel and I have the Saturation Value (this is certainly easier to do than explain).

Seems to work pretty well and it matches exactly the longer Action I created where I just found the Maximum and Minimum of the RGB tripple and subtracted those two together. Was just messing around to see if I could come up with a more efficient approach (even through the "how it works" is not very obvious).

Again, you don't have to know how the sausage (meat or meatless) is made to enjoy eating the sausage. Enjoy
 

Top