How do I clip pixel layers to vector layers for shading

Hier diskutieren die Anwender von PhotoLine untereinander
User avatar
shijan
Mitglied
Posts: 1784
Joined: Mon 23 Dec 2019 15:21
Location: Ukraine

Re: How do I clip pixel layers to vector layers for shading

Post by shijan »

By the way, as i remember this sort of missing clipping Pass Through mode was discussed earlier, but in less details.
It is possible to emulate Pass Through clipping using virtual copy of the group and with applied Levels intensity in HIS mode to adjust the brightness of that virtual copy, like this:
Screen Shot 2025-02-11 at 7.13.30 PM.jpg
outlineproblem.pld
You do not have the required permissions to view the files attached to this post.
PhotoLine UI Icons Customization Project: https://www.pl32.com/forum3/viewtopic.php?f=3&t=6302
Vivi_Ram
Mitglied
Posts: 229
Joined: Sat 28 Sep 2024 17:04

Re: How do I clip pixel layers to vector layers for shading

Post by Vivi_Ram »

Thanks for that @Shijan. This is a workaround that may work for simple scenarios, yes. But it doesn't work for most situations. A pass through blend essentially helps to create mini documents within documents. Toggling pass through on and off helps to create degrees of isolation that are hard to achieve in any other way.
User avatar
Herbert123
Mitglied
Posts: 2370
Joined: Sat 12 May 2012 21:38

Re: How do I clip pixel layers to vector layers for shading

Post by Herbert123 »

Wait, but: pass through mode set to a group in Photoshop merely ignores the effect of grouping, and treats groups as an organizational tool only.

In PhotoLine --as far as I am aware-- a group already behaves exactly like that when Draw Isolated is left inactive. There is no difference. That is also why it is impossible to select a blend mode.

Granted: instead of that checkbox perhaps it would be preferable to add a Pass Through blend mode to improve the usability of this function.

Or am I missing something here?
/*---------------------------------------------*/
System: Win10 64bit - i7 920@3.6Ghz, p6t Deluxe v1, 48gb (6x8gb RipjawsX), Nvidia GTX1080 8GB, Revodrive X2 240gb, e-mu 1820, 2XSamsung SA850 (2560*1440) and 1XHP2408H 1920*1200 portrait
User avatar
Herbert123
Mitglied
Posts: 2370
Joined: Sat 12 May 2012 21:38

Re: How do I clip pixel layers to vector layers for shading

Post by Herbert123 »

...There remains an issue. In Photoshop it is easy to use the vector layer (or bitmap layer) as a clipping mask for the layers above (using the ALT key). The contents of that vector layer remains visible. And then it is simple to paint shading layered on top of it.

This setup cannot be replicated in PhotoLine without the addition of an extra virtual layer, because the underlying vector layer cannot clip the content above by itself. Moving that layer on top of the shading layer merely hides the shading, unless the blend mode is changed of the vector layer. But that is unwanted behaviour. The underlying layer should clip the shading layer(s) above.

As far as I am aware, there is no direct equivalent in PhotoLine to duplicate this approach with just two layers AND also maintain the required pass-through behaviour (the layers' blend mode affect the layers below in the layer stack).

The only solution is to virtually clone the underlying vector layer, and place it on top as a clipping mask layer. That means one additional layer in the stack, though.

This has nothing to do with the lack of a pass through layer blend mode (because in effect this actually the default behaviour of a group in PhotoLine), but is the result of a missing option to allow a layer lower in the layer stack to clip the contents higher up in the layer stack AND keeping the content of that lower layer visible.

Here is Photoshop's clipping mask. When grouped and with the group set to Pass Through the blend mode of the layers will comp with the underlying layers in the file.
2025-02-11 22_20_42-#1.png
Here is PhotoLine's solution:
2025-02-11 22_20_55-#1.png
The layers will blend with the underlying layers in the composition, but it does require that extra virtual copy to clip the contents.

As far as I can tell, there exists no other way to replicate Photoshop's behaviour.
You do not have the required permissions to view the files attached to this post.
/*---------------------------------------------*/
System: Win10 64bit - i7 920@3.6Ghz, p6t Deluxe v1, 48gb (6x8gb RipjawsX), Nvidia GTX1080 8GB, Revodrive X2 240gb, e-mu 1820, 2XSamsung SA850 (2560*1440) and 1XHP2408H 1920*1200 portrait
Vivi_Ram
Mitglied
Posts: 229
Joined: Sat 28 Sep 2024 17:04

Re: How do I clip pixel layers to vector layers for shading

Post by Vivi_Ram »

I didn't explain myself clearly enough. Sorry.

It's not merely in shading scenarios that I need to use pass through. For instance, if want to clip adjustments to a particular image in the composition without any masks, I can simply group all the relevant adjustments, and turn on pass through. It's effectively the same as masking. On the other hand, there are scenarios where I want to toggle off the default behaviour of PL. So, independent of the shading scenario, pass through is good to have.

P.S: you're right. You can still already do this I suppose but in a different way. Draw Isolated. Draw Isolated works as an organisational separation.

But simply emulating shading is quite circuitous in PL.
User avatar
shijan
Mitglied
Posts: 1784
Joined: Mon 23 Dec 2019 15:21
Location: Ukraine

Re: How do I clip pixel layers to vector layers for shading

Post by shijan »

Herbert123 wrote: Wed 12 Feb 2025 07:19 Wait, but: pass through mode set to a group in Photoshop merely ignores the effect of grouping, and treats groups as an organizational tool only.

In PhotoLine --as far as I am aware-- a group already behaves exactly like that when Draw Isolated is left inactive. There is no difference. That is also why it is impossible to select a blend mode.
Grouped Adjustment Layers behave like real pass trough, but Clipping layers don't. In PhotoLine grouped Clipping layers can't clip anything outside the group.
Granted: instead of that checkbox perhaps it would be preferable to add a Pass Through blend mode to improve the usability of this function.
It could be both: "Pass Through" blend mode for Isolated group and checkbox for Layer in Layer Attributes.
PhotoLine UI Icons Customization Project: https://www.pl32.com/forum3/viewtopic.php?f=3&t=6302
User avatar
Herbert123
Mitglied
Posts: 2370
Joined: Sat 12 May 2012 21:38

Re: How do I clip pixel layers to vector layers for shading

Post by Herbert123 »

shijan wrote: Wed 12 Feb 2025 09:25
Herbert123 wrote: Wed 12 Feb 2025 07:19 Wait, but: pass through mode set to a group in Photoshop merely ignores the effect of grouping, and treats groups as an organizational tool only.

In PhotoLine --as far as I am aware-- a group already behaves exactly like that when Draw Isolated is left inactive. There is no difference. That is also why it is impossible to select a blend mode.
Grouped Adjustment Layers behave like real pass trough, but Clipping layers don't. In PhotoLine grouped Clipping layers can't clip anything outside the group.
Granted: instead of that checkbox perhaps it would be preferable to add a Pass Through blend mode to improve the usability of this function.
It could be both: "Pass Through" blend mode for Isolated group and checkbox for Layer in Layer Attributes.
Yes, true - I forgot about the "super adjustment layer" and grouped adjustment layers.

Sure, Pass Through could be exposed in both ways.

I do have to add here that while PhotoLine needs an extra virtual layer to solve this, Clipping masks/layers in Photoshop are much more limited. We have more freedom in PhotoLine thanks to the virtual layer system.

Give and take. Depends on the context. That said, it would be nice to have some kind of clipping layer option that allows us to clip using a bottom layer and still display its contents without the need for an additional virtual clone.
/*---------------------------------------------*/
System: Win10 64bit - i7 920@3.6Ghz, p6t Deluxe v1, 48gb (6x8gb RipjawsX), Nvidia GTX1080 8GB, Revodrive X2 240gb, e-mu 1820, 2XSamsung SA850 (2560*1440) and 1XHP2408H 1920*1200 portrait
User avatar
Herbert123
Mitglied
Posts: 2370
Joined: Sat 12 May 2012 21:38

Re: How do I clip pixel layers to vector layers for shading

Post by Herbert123 »

To be honest, I don't mind this too much - there is a solution.

But the one thing missing in PhotoLine's layer stack that I sorely miss is the option to chain/lock the transformation between layers/groups.

I desperately want to be able to lock the transformation between layers anywhere in the layer stack. We can virtually clone layers to use as masks anywhere - but no option to propagate the transformations between those masks and other related layers by simply locking that transformation between them.
/*---------------------------------------------*/
System: Win10 64bit - i7 920@3.6Ghz, p6t Deluxe v1, 48gb (6x8gb RipjawsX), Nvidia GTX1080 8GB, Revodrive X2 240gb, e-mu 1820, 2XSamsung SA850 (2560*1440) and 1XHP2408H 1920*1200 portrait
User avatar
Hoogo
Betatester
Posts: 4106
Joined: Sun 03 Jul 2005 13:35
Location: Deutschland

Re: How do I clip pixel layers to vector layers for shading

Post by Hoogo »

So I googled a little what that Passthrough is doing. And I was thinking why I never missed that Passthrough. Not 100% sure what it is, but it seems to be a matter of UI.
- PS and others have "Passthrough" or "Other blend modes"
- PL has "draw isolated" or not "draw isolated". Not isolated = "Passthrough", and isolated = "Other blend modes enabled"

The whole topic came up when "draw isolated" was needed for protecting transparency/ clip an object to the shape of another object below. "Draw isolated" solves that problem, but no there's a new one: An adjustment, multiplication layer or whatever in that group that should also affect the background outside the group.

So I was thinking about the most complicated stuff: A slightly matte green glass bottle with a label, filled half with water, causing caustics and dropping shows on the background. That would include blurring the background in the shape of the bottle, imho the perfect example where "draw isolated" would prevent simply including that adjustment into the group.

I would keep the blur behind the isolated group of the bottle, clip with a virtual copy of the shape, and group it all into "whole bottle". With shadows and caustics you would end up with a similar layer stack anyways.
----------------
Herr Doktor, ich bin mir ganz sicher, ich habe Atom! /Doctor, doctor, I'm sure, I've got atoms!
User avatar
shijan
Mitglied
Posts: 1784
Joined: Mon 23 Dec 2019 15:21
Location: Ukraine

Re: How do I clip pixel layers to vector layers for shading

Post by shijan »

Seems i was able to make it work. You need to use Group with "Show and Clip" view mode.
In addition, if you want to move all this structure together, you can add it to another group and also set it to "Show and Clip" mode combined with Virtual copy applied to raster drawing layer.
Screen Shot 2025-02-13 at 1.35.36 AM.jpg
vectorcliptest.pld
Note that "Draw Isolated" mode rasterizes vectors, so your masks are no longer vector based. But it is possible to keep everything in vector if instead of using Isolated Group, toggle "Non-Zero-Winding Number" in Toolbox vector settings. So multiple vector layers inside normal group will not mask each other and give you solid filled mask:
intersect-1.jpg
intersect-2.jpg
vectorcliptest-2.pld
You do not have the required permissions to view the files attached to this post.
PhotoLine UI Icons Customization Project: https://www.pl32.com/forum3/viewtopic.php?f=3&t=6302
User avatar
Hoogo
Betatester
Posts: 4106
Joined: Sun 03 Jul 2005 13:35
Location: Deutschland

Re: How do I clip pixel layers to vector layers for shading

Post by Hoogo »

shijan wrote: Thu 13 Feb 2025 01:58 Seems i was able to make it work.
You lost me... What was your goal here?
lost.png
You do not have the required permissions to view the files attached to this post.
----------------
Herr Doktor, ich bin mir ganz sicher, ich habe Atom! /Doctor, doctor, I'm sure, I've got atoms!
User avatar
Herbert123
Mitglied
Posts: 2370
Joined: Sat 12 May 2012 21:38

Re: How do I clip pixel layers to vector layers for shading

Post by Herbert123 »

Hoogo wrote: Thu 13 Feb 2025 06:36
shijan wrote: Thu 13 Feb 2025 01:58 Seems i was able to make it work.
You lost me... What was your goal here?
lost.png
The problem is that to make that transparent clipping work, the group has to be set to "Draw Isolated". But the moment that is the case, the layers inside the group no longer blend with the background outside the group.

The confusion is caused by the white background. @shijan should have used a photo instead to demonstrate the blending issue.

@Hoogo: change the blend mode of the red diamond to multiply. It will multiply with the yellow square, but not with the background because the group is set to isolated drawing.

The wanted behaviour is:
[1] all layers inside the group blend with the content below that is OUTSIDE the group
AND
[2] the brush stroke(s) are clipped by the diamond and square shape
AND
[3] the diamond shape and square shape's content remains visible.

In Photoshop, Krita, Affinity Photo (for example) this is possible without extra clipping layers.
/*---------------------------------------------*/
System: Win10 64bit - i7 920@3.6Ghz, p6t Deluxe v1, 48gb (6x8gb RipjawsX), Nvidia GTX1080 8GB, Revodrive X2 240gb, e-mu 1820, 2XSamsung SA850 (2560*1440) and 1XHP2408H 1920*1200 portrait
User avatar
shijan
Mitglied
Posts: 1784
Joined: Mon 23 Dec 2019 15:21
Location: Ukraine

Re: How do I clip pixel layers to vector layers for shading

Post by shijan »

Here is new and probably simplest possible version:
"Protected Underlying Transparency" enabled in painting layer.
Vector objects with enabled "Non-Zero-Winding Number".
"Show and Clip" view mode now use icon from new version of my customization Pack.
Screen Shot 2025-02-13 at 8.47.03 AM.jpg
vectorcliptest-3.pld
P.S. seems this version also have a problem - if group everything and enable "Show and Clip", it will use colors of "Protected Underlying Transparency" painting layer as transparency:
Screen Shot 2025-02-13 at 9.00.33 AM.jpg
Version with virtual copy mask don't have this problem:
Screen Shot 2025-02-13 at 9.03.46 AM.jpg
You do not have the required permissions to view the files attached to this post.
PhotoLine UI Icons Customization Project: https://www.pl32.com/forum3/viewtopic.php?f=3&t=6302
User avatar
Herbert123
Mitglied
Posts: 2370
Joined: Sat 12 May 2012 21:38

Re: How do I clip pixel layers to vector layers for shading

Post by Herbert123 »

I believe my version is still the simplest one? :?: :mrgreen:

Image
/*---------------------------------------------*/
System: Win10 64bit - i7 920@3.6Ghz, p6t Deluxe v1, 48gb (6x8gb RipjawsX), Nvidia GTX1080 8GB, Revodrive X2 240gb, e-mu 1820, 2XSamsung SA850 (2560*1440) and 1XHP2408H 1920*1200 portrait
User avatar
Hoogo
Betatester
Posts: 4106
Joined: Sun 03 Jul 2005 13:35
Location: Deutschland

Re: How do I clip pixel layers to vector layers for shading

Post by Hoogo »

Herbert123 wrote: Thu 13 Feb 2025 09:45 I believe my version is still the simplest one? :?: :mrgreen:
I think so. Shijans version looks more complicated, because he's experimenting with combining 2 vectors into 1 shape for clipping.
----------------
Herr Doktor, ich bin mir ganz sicher, ich habe Atom! /Doctor, doctor, I'm sure, I've got atoms!