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

Creating separate HSL layers


Recommended Posts

Here's the result of a whole bunch of experimenting over Christmas and the New Year that led to a way to not only create separate Hue, Saturation and Luminosity layers, but also how to recombine them back to the original image. As a result you can now separately edit each of H, S and L, applying the full power of APh to each.

In summary:

  • Duplicate twice (three times if you want to keep a copy of the original)
  • Rename Hue, Saturation and Luminosity from the top
  • in Hue layer, Filters/Apply Image, Use Current Layer as Source, Equations (check), then set:
    • DR=(SR-min(SR,SG,SB))/(max(SR,SG,SB)-min(SR,SG,SB))
    • DG=(SG-min(SR,SG,SB))/(max(SR,SG,SB)-min(SR,SG,SB))
    • DB=(SB-min(SR,SG,SB))/(max(SR,SG,SB)-min(SR,SG,SB))
  • Apply, then set Hue layer Blend Mode to Multiply
  • In Saturation layer, go to Apply Image as above and set each of DR, DG and DB to max(SR,SG,SB)-min(SR,SG,SB)
  • Apply, then create a group for Hue and Saturation layers, and set the Blend Mode to Add
  • In Luminosity layer, go to Apply Image as above and set each of DR, DG and DB to min(SR,SG,SB)

Now you should see the original image. Edit the HSL layers as you will, noting:

  • In editing the Hue layer, you change basic hue but not saturation or luminance. This may be a bit confusing and seem like nothing is happening if you're not careful.
  • In editing the Saturation layer, this is not a luminance layer, so don't try sharpening it. Rather, make areas darker or lighter to change colours to be greyer or more vivid.
  • In editing the Luminance layer, you can apply noise reduction and sharpening here, rather than on other layers (unless you're getting really creative!).

Further note: if you want separate RGB hue layers, you can make, for example in the Red layer, DG and DB zero and then Add and group.

Note for the purists: Yes, it may not use the 'proper' algorithm, but it is a working, practical solution.

And here's a video of it all, from my InAffinity YouTube channel:

 

Dave Straker

Cameras: Sony A7R2, RX100V

Computers: Win10: Chillblast i9 Custom + Philips 40in 4K & Benq 23in; Surface Pro 4 i5; iPad Pro 11"

Favourite word: Aha. For me and for others.

Link to comment
Share on other sites

10 hours ago, dmstraker said:
  • DR=(SR-min(SR,SG,SB))/(max(SR,SG,SB)-min(SR,SG,SB))
  • DG=(SR-min(SR,SG,SB))/(max(SR,SG,SB)-min(SR,SG,SB))
  • DB=(SR-min(SR,SG,SB))/(max(SR,SG,SB)-min(SR,SG,SB))

What happens if the source colour is grey (SR=SG=SB). The  denominator will then be zero.

Should the second and third lines be:

  • DG=(SG-min(SR,SG,SB))/(max(SR,SG,SB)-min(SR,SG,SB))
  • DB=(SB-min(SR,SG,SB))/(max(SR,SG,SB)-min(SR,SG,SB))

They are in the video.

John

Windows 10, Affinity Photo 1.10.5 Designer 1.10.5 and Publisher 1.10.5 (mainly Photo), now ex-Adobe CC

CPU: AMD A6-3670. RAM: 16 GB DDR3 @ 666MHz, Graphics: 2047MB NVIDIA GeForce GT 630

Link to comment
Share on other sites

1 hour ago, John Rostron said:

What happens if the source colour is grey (SR=SG=SB). The  denominator will then be zero.

Should the second and third lines be:

  • DG=(SG-min(SR,SG,SB))/(max(SR,SG,SB)-min(SR,SG,SB))
  • DB=(SB-min(SR,SG,SB))/(max(SR,SG,SB)-min(SR,SG,SB))

They are in the video.

John

Thanks, John. Post fixed.

Yes, I wondered about the divide-by-zero problem. But APh seems to cope ok. I tried it on a monochrome image and the Hue was same mono, Saturation black and Luminosity mono. Difference'd with original showed no abnormalities.

Dave Straker

Cameras: Sony A7R2, RX100V

Computers: Win10: Chillblast i9 Custom + Philips 40in 4K & Benq 23in; Surface Pro 4 i5; iPad Pro 11"

Favourite word: Aha. For me and for others.

Link to comment
Share on other sites

I was wondering why you did not create a macro to perform this separation.  I tried it and found out why. You cannot group layers in a macro!

John

Windows 10, Affinity Photo 1.10.5 Designer 1.10.5 and Publisher 1.10.5 (mainly Photo), now ex-Adobe CC

CPU: AMD A6-3670. RAM: 16 GB DDR3 @ 666MHz, Graphics: 2047MB NVIDIA GeForce GT 630

Link to comment
Share on other sites

3 minutes ago, John Rostron said:

I was wondering why you did not create a macro to perform this separation.  I tried it and found out why. You cannot group layers in a macro!

John

You can create groups, though it's non-obvious.

  • Select bottom layer of group.
  • Arrange/Group
  • Select next layer up.
  • Arrange/Move inside

And so on.

Currently working on macro set around this and more. May release today if I finish it.

Dave Straker

Cameras: Sony A7R2, RX100V

Computers: Win10: Chillblast i9 Custom + Philips 40in 4K & Benq 23in; Surface Pro 4 i5; iPad Pro 11"

Favourite word: Aha. For me and for others.

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.