• Please use real names.

    Greetings to all who have registered to OPF and those guests taking a look around. Please use real names. Registrations with fictitious names will not be processed. REAL NAMES ONLY will be processed

    Firstname Lastname

    Register

    We are a courteous and supportive community. No need to hide behind an alia. If you have a genuine need for privacy/secrecy then let me know!
  • Welcome to the new site. Here's a thread about the update where you can post your feedback, ask questions or spot those nasty bugs!

Photoshop - Asher's technique for "thin" images

Doug Kerr

Well-known member
In another thread (discussed in yet another), Asher described a technique for dealing, in Photoshop, with images that are "thin" in some or all areas - that is, are overly light without much "depth" of modulation.

The mathematical implications of this technique are quite clever, and I thought I would discuss them here (in a hopefully-benign way).

The technique

• Above the layer containing the image to be improved, place an adjustment layer. It can be any of several types - Curves, Brightness/Contrast, Levels, etc. We will not be actually using the adjustment it provides - that is, we leave it set at its default ("no adjustment") - so it really doesn't matter which of those it is. It is just a mindless pawn in a clever mathematical ploy.

• Set the blend mode of the adjustment layer to Multiply.

We will now see that the image is considerably "deeper and darker" all over.

We can then use a pixel mask on the adjustment layer to control what parts of the image receive this treatment - and how potently. Where the mask is transparent (white), the treatment is applied full force. Where the mask is opaque (black), the treatment is not applied at all. Where the mask is semitransparent (gray), the treatment is applied but not with full force.

If the problem areas of the image are in the minority, we may wish to start with the mask opaque (black) everywhere. If our settings are such that when we make an adjustment layer a mask for it is automatically created - and it will be transparent everywhere - we can just use the Invert button on the mask panel to make it all opaque. If no mask is automatically created, we can make one that is all opaque (black) to begin with by Alt-clicking on the Add a pixel mask icon on the masks panel.

Then we can paint on the mask with the color white, but with the brush set to a low opacity (maybe 25%). The effect is that each pass of the brush makes the mask a little more transparent (closer to white from black). Thus we will see the effect of the "treatment" slowly get greater and greater where we paint. (I find the "airbrush" mode of the brush nice for this work.)

Note that Asher's description has us starting with an all-white mask, initially allowing the treatment to be applied full-force across the image, and then painting on the mask with black to diminish or completely suppress the treatment as appropriate.​

How does this work

To understand how this works from a sort-of-mathematical basis, we have to use a perhaps-unfamiliar way of looking at the working of adjustment layers of this class, used for their normal purposes (to actually make image adjustments). In effect, the adjustment layer has as its "content" a copy of the pixels of the layer below, with the adjustment (for example, a Curves adjustment) applied everywhere. We cannot see this "secret load".

But wherever the mask on the adjustment layer is white (transparent), it "lets those pixels fully through" into the image buildup. Assume for the moment that the adjustment layer does not have blending mode Multiply but rather Normal. Then those full potency pixels "cover up" the pixels in the main image layer, and in those regions we see the pixels as affected by the adjustment. (We can, in this case, also think of this as the mask "letting through the adjustment. But that outlook will not work for our actual situation here.)

Where the mask is black (opaque), it does not let its adjusted pixels through at all into the image buildup. Thus, they don't "cover up" the pixels on the main image layer, and in such regions we see the unadjusted image.

Now, if in a region of the mask with transparency 40%, the adjusted pixels in the adjustment layer's secret load are let through with "potency" 40%, and participate that way in the image buildup. They "40% cover up" the pixels of the main image layer, which then participate in the image buildup at only 60% of par. Thus the adjustment, in effect, is works at "40% of full strength".

Now, with that outlook in hand, let's return to the real scenario of interest - with the blend mode of the adjustment layer at Multiply. Recall that (we will presume) we leave the "adjustment" set at "none". Thus the pixels in the adjustment layer's secret load are identical to the pixels in the main image layer.

Now, to follow the action, we'll start with a region in which the mask transparency is 100%, and look at some single pixel there.

For any given channel (say, R), the value for the "adjusted" pixel from the adjustment layer's secret load is "let through as is" and is then multiplied by the value for the unadjusted pixel from the main image layer. The result is the effective R value of the pixel in the composite image.

But since the R values of the two pixels are identical (no actual adjustment being applied in the adjustment layer), this result is just the square of that R value. (Note that for this to work numerically, we must work with R, G, and B on a scale of 0-1, not 0-255.). The R values of the composite image are different from the R values of the original image - the result of the treatment. (The implications of this change will be discussed shortly.)

Now, where the mask is opaque (black), the value of the pixel in the adjustment layer's secret load is not used, but rather the value R=1. (This is different from what would happen with the Normal blend mode.) The "lower" factor is the actual R value in the main image layer. Now the result of the multiplication is just the R value of the pixel in the Main image layer. The image has not been impacted by the "treatment".

Where the mask is 40% transparent, the "upstairs" factor in the multiplication is made 40% of the way between 1.0 and the R value for the pixel. The value is actually:

0.4 x R + 0.6 x 1.0

The "lower" factor is the actual R value in the main image layer (not, for example, 0.6 of it).

Thus, the "squaring" treatment is only partially applied.

What does that mean

Asher points out that when we do this, it is as if we have several copies of the image pixels, contributing their individual density to give a greater depth of modulation of the density.

In fact, if we care to think of density in the formal photographic way:

d=log (1/Y)

where d is the density and Y is the relative luminance of the pixel of interest, then in an area where the mask is white (transparent), and two identical pixels are "multiplied", the density of the composite will be exactly twice the density of either pixel. (I will spare you the mathematical proof, which is however very simple.) This is exactly what we would have if we sandwiched together two copies of the image as photographic transparencies.

Another outlook

It turns out that wherever we allow this "treatment" to proceed with full force, the result on the affected image is precisely as if the value of the gamma used in the gamma precompensation of the image had been cut to half that for the color space. Thus, when the "real" gamma exponent is used to expand from the nonlinear R, G, and B values to the primary values that we will see on the display, the image will be different from its "untreated" form - the visible tonal scale will be "over-expanded". In particular, as R, G, and/or B decrease, the visible image "gets darker quicker than normal" - just what we want for a "thin" image.

Suppose we don't want so much?

Suppose when we are done painting, and then thoughtfully reconsider our result, we conclude that we have applied the "treatment" a little too much overall .

Its overall effect can be throttled back by setting down the opacity of the adjustment layer.

Can we do this another way

Suppose we, for religious reasons or something, did not want to use the Multiply blend mode. Can we do this same thing some other way?

Absolutely. We in fact use the Curves layer, but this time with the blend mode Normal. But now we actually exercise its real function, and "bow the curve down substantially". If we do that in a certain way (easy to do), the result is as if as if the value of the gamma used in the gamma precompensation of the image had been half that for the color space. This is exactly the same result as with the technique using the adjustment layer, with "no adjustment", as an inert pawn with a Multiply blend mode.

Interestingly enough, in Picture Publisher (my normal image editor), in the Curves panel, there is a slider one can use to change the curve to produce the same effect as the reduction (or increase) of the gamma apparently used in the image gamma precompensation, compared to the actual gamma of the color space. This is in fact how I, in most cases, "darken" an image.

************

Yes, this note happened at this time of the morning because I improvidently had a bowl of potato chips before going to bed, with no insulin to process them with.

My serum glucose is now below 200 mg/dL, and I'm going back to bed.

Best regards,

Doug
 

Asher Kelman

OPF Owner/Editor-in-Chief
Doug,

An excellent and helpful analysis. Still there's another aspect to this. There's a "religious", almost dogmatic aspect to this discussion, LOL! If one refers to the layer below, then "black reveals and white conceals". That's the perspective from which a lot of us look at masks so perhaps that might be taken into account when describing how the process of building up works with respect to the actual picture, rather than the layer which modulates its appearance! :)

However, in pure Photoshop terms, the reference is exactly as you describe. We refer the changes in the mask correctly to the layer which is masked. "White reveals and black conceals".

Asher
 

Andrew Rodney

New member
Making a “blank” Adjustment layer set to Multiply (or whatever blend you prefer) OR duplicating the layer and applying the same blend appear to produce the same results (prior to using a mask if so desired). So how does that play into the analysis, if any, if the above assumption is true?

There is one interesting and useful behavior I noticed using the “blank” adjustment layer instead of the duplicate layer. Put some eyedropper samples on the bkgnd layer first so you can see four areas in the image and their RGB read-outs.

With the “blank” layer technique, you see the before and after values which is kind of nice. With the duplicate layer, you don’t which makes sense.
 

Doug Kerr

Well-known member
Hi, Andrew,

Making a “blank” Adjustment layer set to Multiply (or whatever blend you prefer) OR duplicating the layer and applying the same blend appear to produce the same results (prior to using a mask if so desired). So how does that play into the analysis, if any, if the above assumption is true?

An adjustment layer (with the adjustment at the "default") in effect has "content" which is a duplicate of the content of the layer below (although we never can view that directly).

I suspect the same is true of a blank adjustment layer.

With the adjustment layer blend mode at Multiply, the result will then be that in the composite image, the observed value of a color coordinate (for example, "R") will be the product of the value at that pixel on the image layer and the value on the adjustment layer (which is the same). Thus the resulting R value will be the square of the original value. (Again, we have to do this with the coordinates on a 0-1 scale, rather than 0-255, for the numbers to work out).

If instead of an adjustment layer, we make a duplicate of the image layer in a layer above, and set its blend mode to Multiply, I would think the scenario will be exactly the same.

There is one interesting and useful behavior I noticed using the “blank” adjustment layer instead of the duplicate layer. Put some eyedropper samples on the bkgnd layer first so you can see four areas in the image and their RGB read-outs.

With the “blank” layer technique, you see the before and after values which is kind of nice. With the duplicate layer, you don’t which makes sense.
Interesting. I'll have to play with that.

Thanks for your thoughts.

Best regards,

Doug
 

Andrew Rodney

New member
The advantage to the Adjustment layer is a smaller doc assuming that Photoshop treats that layer as ‘transparent’ so to speak (no pixels). IOW, if you have two layers and the 2nd only has half that layer drawn in pixels and half transparent, it will save as a smaller doc than if that 2nd layer had no transparency. Otherwise I can’t see a reason (yet) not to use the adjustment layer for this kind of work. OR would one ever want to apply filters to the actual pixels on that 2nd layer? In that case, the adjustment layer would not work as well. Would one ever blur that 2nd layer, or apply something that expects actual pixels? Hum... there may be other implications here after all.
 

Doug Kerr

Well-known member
Hi, Andrew,
The advantage to the Adjustment layer is a smaller doc assuming that Photoshop treats that layer as ‘transparent’ so to speak (no pixels).
Oh, an excellent point

IOW, if you have two layers and the 2nd only has half that layer drawn in pixels and half transparent, it will save as a smaller doc than if that 2nd layer had no transparency. Otherwise I can’t see a reason (yet) not to use the adjustment layer for this kind of work. OR would one ever want to apply filters to the actual pixels on that 2nd layer? In that case, the adjustment layer would not work as well. Would one ever blur that 2nd layer, or apply something that expects actual pixels? Hum... there may be other implications here after all.

And of course the way I do it is with a Curves adjustment layer in the usual way (been doing that for years in Picture Publisher)!

As of yet, I don't see why that would not produce the same result. (To get exactly the same result, and I can't imagine why there is any magic in that, you need to make a certain curve.)

Best regards,

Doug
 

Doug Kerr

Well-known member
If we apply a Curve adjustment with a curve whose equation is C'=C^2, where C' is the output value of R, G, or B and C is the input value of R, G, or B (where we reckon those on a scale of 0-1 rather than 0-255), then the effect on the image should be identical to that from using the "default adjustment layer and multiply" scheme.

Such a curve looks like this (this is done in Picture Publisher, which will make one for me):

Gamma_curve_01.jpg

Picture Publisher half-gamma curve​

In Photoshop, we can make essentially such a curve by grabbing the default (linear) curve at its center and dragging that point down to half its original height (that would be 1/4 of the vertical axis).

Here is what that looks like:

Gamma_curve_02.jpg

Photoshop half-gamma curve​

There is of course no need to get such a curve precisely; there is nothing magical about this particular "treatment".

I have not yet confirmed that the effect different mask transparency has on modulating the "treatment" is the same for the use of the curve and the use of the "default adjustment layer and multiply" scheme. Ach aye the noo.

Best regards,

Doug
 

Doug Kerr

Well-known member
It appears that for these two techniques of applying a certain "treatment" to an image:

• Use an adjustment layer with the adjustment at the default (no adjustment), and blend mode Multiply.

• Use a Curves adjustment layer with a curve "R'=R^2", and blend mode Normal

we find that:

• The "full-on" treatment (no mask in effect on the adjustment layer) produces the same result for both schemes

• With a layer mask on the adjustment layer having regions of 100%, 50% and 25% transparency, the results are the same for both schemes (that is, the impact of different mask transparencies for the two schemes is the same).

• With a layer mask on the adjustment layer having regions of 100%, 50% and 25% transparency, and the adjustment layer opacity reduced to 60%, the results are the same for both schemes (that is, the impact of different mask transparencies, concatenated with an overall adjustment layer opacity reduction, for the two schemes is the same).

• The two PSD files are of almost identical size.

Best regards,

Doug
 

Doug Kerr

Well-known member
Hi, Andrew,

Making a “blank” Adjustment layer set to Multiply (or whatever blend you prefer) OR duplicating the layer and applying the same blend appear to produce the same results (prior to using a mask if so desired).
What do you mean by "blank" adjustement layer? Do you mean an adjustment layer of some specific kind with the adjustement set to "none" (as, for example, a Brightness/Contrast adjustment layer with both sliders set at 0), or something else?

Thanks.

Best regards,

Doug
 

Ben Rubinstein

pro member
Going to try this out as soon as PS finishes batching yesterdays shoot!

If anyone is interested I'd appreciate a write up of the difference between all the blend modes, not just how they look but what they are there for. It's a black hole in my PS knowledge.

EDIT, hmm, As Doug mentions it doesn't do anything a simple curve doesn't do. Not sure why someone would use this method.
 
Going to try this out as soon as PS finishes batching yesterdays shoot!

If anyone is interested I'd appreciate a write up of the difference between all the blend modes, not just how they look but what they are there for. It's a black hole in my PS knowledge.

EDIT, hmm, As Doug mentions it doesn't do anything a simple curve doesn't do. Not sure why someone would use this method.

I found once this site, which is a nice straight-forward introduction to blend modes, I don't know if I'll help you...


http://www.photoshopessentials.com/photo-editing/layer-blend-modes/
 

Andrew Rodney

New member
What do you mean by "blank" adjustement layer? Do you mean an adjustment layer of some specific kind with the adjustement set to "none" (as, for example, a Brightness/Contrast adjustment layer with both sliders set at 0), or something else?

Yes, that’s what I was referring to.
 

Doug Kerr

Well-known member
Hi, Sandrine,

I found once this site, which is a nice straight-forward introduction to blend modes, I don't know if I'll help you...

http://www.photoshopessentials.com/photo-editing/layer-blend-modes/
Thanks for the tip. It looks interesting.

So far I have only read the discussion of the Multiply blend mode. That is in fact in terms of using it as Asher has discussed.

There is no clue as to why we might choose to do this rather than just using a Curves layer in the ordinary way to produce the identical result.

Of course, in this technique, one doesn't have to make the needed curve, although that is hardly a tedious operation. (I keep a predefined one - called "Half_gamma" - in the repertoire.)

Thanks again,

Best regards,

Doug
 

fahim mohammed

Well-known member
I am told that in very ancients times the High Priests of the Temples ( or their equivalent )
knew the movements of the planets ( and/or other heavenly objects ).

Now speaking with reference to the above and the Egyptian Temple Priests, this knowledge of the
position of heavenly bodies during the various times of the earth year, gave them considerable power.

They could predict the flooding of the Nile ( for example ) and as such their influence was 'astronomical '.

Now, during this time lived a man they called Fahim . He has no dark knowledge. He has been wasting his time lying awake all night year after year..watching for example the rising of certain ' heavenly bodies ' in the skies. Fahim is a very simple , unassuming man. From a nomad family.

One night he sees that same ' friend ' appear in the sky. He looks around. Yes the other ' friends ' too are where he expects them to be in the sky.

He rushes to his tribe. Listen, he tells them, plant your seeds now. Nobody believes him at first.
Later the Pharoah's men are seen planting seeds.

Next year, the tribe asks fahim, what his ' magic ' tells him they should do at a different time of the year. Fahim goes away from the date palms of the Nile into the desert..to gaze at his friends in the sky. He returns and tells his tribe to start harvesting, or seek higher ground as the case maybe.

News reaches the High Priests. Who dare challenge the Son of RA. Fahim is executed.

That lazy man's name was not really Fahim. The tribe started calling him that. It means the one who understands, the intelligent one.

Why relate this story here? Fahim did not know anything. He did not go the High Priest ( or wait to be told by the High Priestess ). He just watched and told others what he learnt in a simple way the tribe could understand. You see Fahim told his tribe to waste their time looking at the sky and told them about his heavenly ' friends'.

Thousands of years later they have given a name to how Fahim passed on his knowledge to his nomadic tribe..it is called Show and Tell.

Regards.
 
• The two PSD files are of almost identical size.

Hi Doug,

A small piece of info; One can save as the proprietary Photohop PSD file format, but one can also save as the more universally supported TIFF format. There is no loss of functionality, but one gains better support by alternative software (TIFF support is more widespread).

Of no consequence to the thread's topic, but perhaps nice to know.

Cheers,
Bart
 

Doug Kerr

Well-known member
Hi, Bart,

Hi Doug,

A small piece of info; One can save as the proprietary Photohop PSD file format, but one can also save as the more universally supported TIFF format. There is no loss of functionality . . .
I hadn't realized that the retention of functionally was complete.

. . . but one gains better support by alternative software (TIFF support is more widespread).

Of no consequence to the thread's topic, but perhaps nice to know.

Thanks for the tip.

Best regards,

Doug
 
Top