Jump to content
You must now use your email address to sign in [click for more info] ×

Contrast Masking?


Recommended Posts

Contrast masking is a technique I've used in both Photoshop and Gimp. But because it involves layers, which work differently in Affinity, I can't figure out how to do it in Affinity. The technique is described here: https://luminous-landscape.com/contrast-masking/ The basic idea is to create a duplicate layer of the original image. Then you desaturate the layer, and then you invert it. Then you change it from "normal" to "overlay". Then you use the Gaussian blur to add the final touches that make it look good. You end up with an image that has less contrast, but in such a way as to bring out more detail. Where I'm going wrong is that Affinity adds a new layer with the desaturation and the inversion instead of doing those things to the layer. I've tried merging all three layers into one and then changing that to "overlay", but that didn't work. I tried just changing each individual layer - no good. I tried to make an adjustment layer without first duplicating the image, but that didn't work. What am I missing?

Link to comment
Share on other sites

Hello melonbird,

 

wellcome to the forum.

 

Here's my take on this. I am not 100% sure if I am explaining this correctly. But I followed the tutorial you linked to and I was able to get a result that looks like what the author of the tutorial shows :)

  1. Open an image in APh
  2. Duplicate the Background layer (CTRL+j) and rename it to 'Contrast Mask' (this is just to distinguish it from the image in the Background).
  3. Go to Adjustment (if not already visible select menu 'View > Studio > Adjustment' and click on 'Black & White'. And there click on 'Default'.
  4. Switch back to the Layers panel. If the 'Black & White' adjustment is above the layer 'Contrast Mask' right click on the 'Black & White' adjustment and select 'Mask to Below'.
    That way the desaturation affects only this particular layer.
  5. Next set the 'Contrast Mask's layer mode to 'Overlay'. This is done from the dropdown box at the very top of the Layers panel. Now you should already see something close to what you are looking for.
  6. Finally make the 'Contrast Mask' layer active (click on it once). Click on the 'Layer Effects' icon at the bottom of the Layers palette. It is the one that says 'fx;)
    In the Layer Effects window that pops up, check the box next to 'Gaussian Blur' and drag the fader right of it to a value of your choice. You can see the effect live on the screen.

I sincerely hope this comes close to what you are looking for.

 

Key is that you need to understand how to assign adjustment layers to only one particular layer. And how to use 'Layer Effects' :)

 

Good luck with contrast masking!

d.

Affinity Designer 1 & 2   |   Affinity Photo 1 & 2   |   Affinity Publisher 1 & 2
Affinity Designer 2 for iPad   |   Affinity Photo 2 for iPad   |   Affinity Publisher 2 for iPad

Windows 11 64-bit - Core i7 - 16GB - Intel HD Graphics 4600 & NVIDIA GeForce GTX 960M
iPad pro 9.7" + Apple Pencil

Link to comment
Share on other sites

You can easily accomplish what you’re describing. Once you duplicate the original pixel layer, desaturate the duplicate with a Black and White adjustment. BUT, click the “Merge” button in the adjustment dialog. This will destructively alter the dulicated pixel layer, rather than adding an adjustment layer above it. Invert the duplicate with the Layer>Invert command. Change the layer blend mode to Overlay, and Now a Gaussian Blur filter on the layer. Either choose the filter from the menu (which changes the layer itself) or add a live filter, but again merge it with the layer. This gets you 2 layers - the original on the bottom, and the duplicated, desaturated, overlay-ed, and blurred layer on top.

Affinity Photo 2, Affinity Publisher 2, Affinity Designer 2 (latest retail versions) - desktop & iPad
Culling - FastRawViewer; Raw Developer - Capture One Pro; Asset Management - Photo Supreme
Mac Studio with M2 Max (2023}; 64 GB RAM; macOS 13 (Ventura); Mac Studio Display - iPad Air 4th Gen; iPadOS 17

Link to comment
Share on other sites

I tried both of these approaches, and I'm still getting the same wrong result. It adds a lot of color enhancement rather than just lightening the shadows and dimming the bright spots. Assuming Affinity's "desaturate" and "invert" features aren't radically different from GIMP or PS, I assume I'm still doing something wrong. In GIMP, for example, desaturation is a single button click.

So here are my exact, very detailed steps. I hope someone can see where I'm going wrong.

  • The "ADJ" tab in the sidebar
  • HSL Adjust
  • Desaturate
  • Then I slide Saturation Shift all the way to the left
  • Then I click Merge
  • Then I click Layer > Invert or ctrl-I
  • Then I change the layer to Overlay

And I get an image where the blues have become more vivid, the soft reds have turned much more orange... it's kind of a Technicolor look, if you remember the old movies that were so brightly colored. 

Link to comment
Share on other sites

27 minutes ago, melonbird said:

I tried both of these approaches, and I'm still getting the same wrong result. It adds a lot of color enhancement rather than just lightening the shadows and dimming the bright spots. Assuming Affinity's "desaturate" and "invert" features aren't radically different from GIMP or PS, I assume I'm still doing something wrong. In GIMP, for example, desaturation is a single button click.

So here are my exact, very detailed steps. I hope someone can see where I'm going wrong.

  • The "ADJ" tab in the sidebar
  • HSL Adjust
  • Desaturate
  • Then I slide Saturation Shift all the way to the left
  • Then I click Merge
  • Then I click Layer > Invert or ctrl-I
  • Then I change the layer to Overlay

And I get an image where the blues have become more vivid, the soft reds have turned much more orange... it's kind of a Technicolor look, if you remember the old movies that were so brightly colored. 

 

Hello melonbird,

 

I followed your instruction and the result is very similar to the way I have done it with the 'Black & White' adjustment layer. But it's not identical.

 

According to the tutorial you linked in your first post you should as a last step add a gaussian blur to the layer to accomplish the desired effect. I do not see this in your listing.

 

Since we are working on different images I can hardly comment on the colors. But I could see a light resemblance of the Technicolor look here, too :)

d.

Affinity Designer 1 & 2   |   Affinity Photo 1 & 2   |   Affinity Publisher 1 & 2
Affinity Designer 2 for iPad   |   Affinity Photo 2 for iPad   |   Affinity Publisher 2 for iPad

Windows 11 64-bit - Core i7 - 16GB - Intel HD Graphics 4600 & NVIDIA GeForce GTX 960M
iPad pro 9.7" + Apple Pencil

Link to comment
Share on other sites

I forgot to mention I was deliberately leaving out the Gaussian step because it doesn't fix color. I get the same results whether I use your Black and White or the Desaturate option. And it doesn't look the same as in GIMP. The point of a Contrast Mask is to bring out more detail. The image in GIMP is far more detailed than the one in Affinity. Here's a sample image.

The original:

original.JPG.6f4e252d4fef76e65ae665c1b2faa304.JPG

 

Shadows are hiding a lot of detail. Now here's the GIMP version after the above steps (no Gaussian blur yet). See how much more detail there is? Shadows are softened. Words on the coin wrappers are easier to read. This is a proper contrast mask. PS produces the same effect.

Gimp.JPG.64b1ba60c5b7b349b54f28ab6eb2f8a2.JPG

 

Now here's Affinity. The shadows are softer, but the detail hasn't improved from the original. Some of the paler colors are deepened or enhanced in a way that distracts from the details. That's the exact opposite of what you want from a contrast mask.

affinity.jpg.248fd29c222ef350c7afed7a3c9a38d4.jpg

Link to comment
Share on other sites

OK, I admit that the technique of "contrast masking" is one I've never heard of before your post. Now that I see your example, I am closer to understanding what you're after. I looked at the Luminous Landscape post you linked to, and I see what he did.

I agree that the Affinity version of this technique changes the colors in ways that look different from what PS does (according to you, since I've never used Photoshop). But, in looking at your coin roll pictures, I can't help but wonder if there's a much simpler way to get to where you're aiming. So, I downloaded your Original Scan (the top picture from the post, above) and I simply applied a Curves adjustment layer.

Here's the Original:

5a86fd4d7e8bb_OriginalCoinRolls.thumb.jpg.7385889703248323bdbdb96e564d3a8c.jpg

and here it is with the Curves Layer sitting above it:

5a86feaf8486f_CoinswithCurves.thumb.jpg.3b0a55d4a452386617e853045bcd4a5c.jpg

I think that's pretty close to what you've shown in your post. Plus, you can tweak the Curves layer (drag the left border up to soften the shadows more; pull the S curve one way or another to introduce more or less contrast, etc.) Does this do what you want?

Affinity Photo 2, Affinity Publisher 2, Affinity Designer 2 (latest retail versions) - desktop & iPad
Culling - FastRawViewer; Raw Developer - Capture One Pro; Asset Management - Photo Supreme
Mac Studio with M2 Max (2023}; 64 GB RAM; macOS 13 (Ventura); Mac Studio Display - iPad Air 4th Gen; iPadOS 17

Link to comment
Share on other sites

1 hour ago, melonbird said:


Now here's Affinity. The shadows are softer, but the detail hasn't improved from the original. Some of the paler colors are deepened or enhanced in a way that distracts from the details. That's the exact opposite of what you want from a contrast mask.

affinity.jpg.248fd29c222ef350c7afed7a3c9a38d4.jpg

 

Thank you for the sample pictures. I have no idea why Affinity comes to a different result but for obvious reasons it is a different program and maybe that is explanation enough :-)

 

Sometimes it is necessary to adapt or to modify the workflow if one works with a new/different program. Obviously you have found a good solution in the Develop persona.

With regard to this particular picture I also suggest to look into the 'Shadows / Highlights' adjustment. It helps especially with the dark parts of the image.

smadel's way with Curves adjustment (see above) is also a very good approach.

 

d.

Affinity Designer 1 & 2   |   Affinity Photo 1 & 2   |   Affinity Publisher 1 & 2
Affinity Designer 2 for iPad   |   Affinity Photo 2 for iPad   |   Affinity Publisher 2 for iPad

Windows 11 64-bit - Core i7 - 16GB - Intel HD Graphics 4600 & NVIDIA GeForce GTX 960M
iPad pro 9.7" + Apple Pencil

Link to comment
Share on other sites

  • 1 year later...

I figured out how to get exactly the same results in Affinity as I got in Gimp with this technique (or that you'd get in Photoshop following a tutorial for using it to create contrast masks). 
 

  • Copy the layer (I change its name to Contrast Mask to keep things clear)
  • Apply an HSL adjustment of Desaturate all the way to b/w
  • Apply Invert adjustment
  • Clip both of the adjustments to the Contrast Mask layer, with Invert on top of "HSL Shift Adjustment"
  • Change the mode of the Contrast Mask to Overlay. At this point, it's looking funky the way it was every time I tried to do this before. 
  • Adjust the mode of the Invert layer adjustment to "Hard Light" <----that's the big trick
  • Now apply a Gaussian Blur effect to the Contrast Mask layer and adjust as desired - it will actually "sharpen" the image because of the inversion effect of the adjustments

This is how the adjustments should look:

928323528_ScreenShot2019-06-15at6_13_25PM.png.a4bfee24da70bdece69de6593747344c.png

Using the same photos as I used above, here's the original again:

original.JPG.985185fcc32d4cbd152fce26492c768b.JPG

The funky Affinity version with contrast mask following exact same instructions as GIMP tutorial:

affinity.jpg.8db7a4016971b9b5c57d77e953b93c08.jpg

The GIMP version with contrast mask, which looked how I wanted but took ages to render:

Gimp.JPG.99900767f993c1ce5ae0ec6a94133cbd.JPG

And now the Affinity version with the new instructions, but with better Gaussian blur use at the end (either because Affinity's tool is easier to see what you're doing with, or it just works better than GIMP's):

affinity-2.jpg.6dd12338cdc07e55c167e1efe2705ba7.jpg

This image is exactly what I wanted. From here, I could tweak the tone, the exposure, etc. But I'm a lousy photographer, so a lot of my photos lack clarity. This is like a magic bullet to fix lack of detail, so I wanted to share it in case anybody else has been trying to figure it out.

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.
Note: Your post will require moderator approval before it will be visible.

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.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.