How do I clip pixel layers to vector layers for shading

Hier diskutieren die Anwender von PhotoLine untereinander
Vivi_Ram
Mitglied
Posts: 229
Joined: Sat 28 Sep 2024 17:04

How do I clip pixel layers to vector layers for shading

Post by Vivi_Ram »

I'm trying to do a very simple operation. I have a vector object. I want to do some shading for this by clipping a pixel layer to it. When I apply clip to it, the vector layer becomes a mask. That's not what I want. I want the vector layer to be visible, and pixel shading to be clipped to it. Like in PS or Krita. In PS, this is achieved by a simple Alt click in between the layers. In Affinity this is achieved by simply dragging and offering the layer to clip layer. How do I do it in PL? :) Thank you!
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 »

After you change layer mode to "Clip" then you can drag it inside any other layer.
In Layer Attributes there is also "Invert" and specially for vector masks some modes (read in manual how they work)
Screen Shot 2025-02-10 at 5.42.36 PM.jpg
You do not have the required permissions to view the files attached to this post.
Last edited by shijan on Mon 10 Feb 2025 17:49, edited 1 time in total.
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 »

Thank you @shijan! Let me try this and get back to you.

Checked it, none of those modes gives the desired result. :( I must be doing something wrong. Let me try explanining again.

What I want to do is to clip an image layer inside of a vector layer, and then paint inside the image layer with pixel brush. At the moment, when I apply the clip, the vector layer turns into different kinds of mask. What I want to is to retain the vector as a vector shape AND show the brush strokes on top of it, but clipped to it.
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 »

I would create a virtual duplicate of the vector and use that as a layer mask, maybe group to move them all together.

Another way: layers have an option "protect underlying transparency". It's hidden in plain sight in the layer list, between the layer mode and the percentage. Enable that option for the upper pixel layer, so the transparency of the vector beneath is kept. That will work with a placeholder or an encapsulated group, but seems rather complicated for that purpose.
----------------
Herr Doktor, ich bin mir ganz sicher, ich habe Atom! /Doctor, doctor, I'm sure, I've got atoms!
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 »

That's essentially what I have been doing currently. I duplicate the layer virtually and then using it as a clip. But this becomes quite a lot of duplicates. Let me try your other suggestion and come back to you @Hoogo.

Yup, lock transparency works as intended! I can then group the layers and keep it tidy!
Clip Alternative.jpg
You do not have the required permissions to view the files attached to this post.
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 »

This however only works for pixel layers clipped to vector. Vector on vector does not respect protect underlying transparency. I would like to request this as a feature. I would like to clip without turning the object into a mask. Whether this object is a vector or pixel.
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 »

I would like to clip without turning the object into a mask. Whether this object is a vector or pixel.
Guess what you asking for it "Show and Clip" view mode? But to be honest i still can't understand what you attempt to do. You can't paint with brush on vector layer. But you can add raster and vector layers to the group and set that group to "Clip" mode.
Screen Shot 2025-02-11 at 3.13.28 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 »

Yes, this works differently in PhotoLine. As far as I am aware we'd always need a group set to Draw Isolated to isolate the clipping and clip the content of the other layers. It takes a little more time to set it up - that said, it does offer more flexibility.

- create the vector layer.
- group it. Set the group to Draw Isolated
- add your bitmap layer or vector layer on top of the vector layer. Set that to protect underlying transparency. When working with multiple bitmap and vector layers: create a group of these and set that group to Draw Isolated and then protect the underlying transparency for the entire group.
clipping.pld
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
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 »

Now that you ask this way...
The vector is fine, in looks and shape and color, just some sparkling pixels should be added that stay within that shape.

But "protect underlying transparency" is not really part of my basic set of tools, and using the vector for clipping seems to be the first and more natural thought.
And by that logic, I'd do this, even though the layer stack is more complicated:
- One huge vector with the color, shape doesn't matter
- Another vector with the shape for clipping
- A pixel layer
- All in a group

By the way: Once there is a layer mask, it's possible to add pixel layers to the vector layer. This is NOT a group, but attachments to a layer.
It does not work as expected, only the vector is clipped, but might be handy elsewhere. I'm not sure if the whole functionality is just a side effect of having a layer mask...
Only clipping.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!
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 tried vector on vector clipping. But let me try both your suggestions and get back to you.
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 »

Herbert123 wrote: Tue 11 Feb 2025 08:13 Yes, this works differently in PhotoLine. As far as I am aware we'd always need a group set to Draw Isolated to isolate the clipping and clip the content of the other layers. It takes a little more time to set it up - that said, it does offer more flexibility.

- create the vector layer.
- group it. Set the group to Draw Isolated
- add your bitmap layer or vector layer on top of the vector layer. Set that to protect underlying transparency. When working with multiple bitmap and vector layers: create a group of these and set that group to Draw Isolated and then protect the underlying transparency for the entire group.

clipping.pld
This exactly what I wanted. But it's quite a few steps. I have to set up groups everytime, presumably. I wonder if there's a simpler and more straightforward way to achieve this without sacrificing the flexibility that this offers. I agree that this is far more flexible than anything PS or Affinity has to offer. I will dive into the shortcuts to see if this behaviour can be triggered with a keystroke.

This can be automated with Actions. FYI.
Last edited by Vivi_Ram on Tue 11 Feb 2025 10:22, edited 1 time in total.
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 »

There is however a further limitation even with this. And it's a limitation that's caused by the fact that PL does not have a "Passthrough" blend mode, which would allow the blend modes of the group affect the layers beneath them. At the moment, I can set the blend mode of individual objects within the group, and all the blend modes are isolated within that group. Next, I can set the blend mode of the whole group. But this does not merely cascade the blend modes of the invidual items within the group to layers below. This group blend mode acts as a whole another level of blending. Which is a tad problematic. There needs to be a simple "Passthrough" blend mode. Wihtout this, I cannot achieve shading work in PL. I can of course link into Krita or Inkscape. But Passthrough is necessary for even other kinds of work.
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 »

Vivi_Ram wrote: Tue 11 Feb 2025 10:13 There is however a further limitation even with this. And it's a limitation that's caused by the fact that PL does not have a "Passthrough" blend mode, which would allow the blend modes of the group affect the layers beneath them. At the moment, I can set the blend mode of individual objects within the group, and all the blend modes are isolated within that group. Next, I can set the blend mode of the whole group. But this does not merely cascade the blend modes of the invidual items within the group to layers below. This group blend mode acts as a whole another level of blending. Which is a tad problematic. There needs to be a simple "Passthrough" blend mode. Wihtout this, I cannot achieve shading work in PL. I can of course link into Krita or Inkscape. But Passthrough is necessary for even other kinds of work.
I don't get it
- There are normal groups, the default. Layer mode is disbaled. The group is just a bracket for all the included elements, to move and show them together.
- Ther is the "draw isolated" propert in the layer attributes. The group is a "picture in picture" with a layer mode. Like all elements were in a file of their own, and only the result was copied to the real picture. No way that the elements could affect the layers below individually.

I don't really get what kind of group you're talking about.
----------------
Herr Doktor, ich bin mir ganz sicher, ich habe Atom! /Doctor, doctor, I'm sure, I've got atoms!
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 am talking about the file shared by Herbert123.

Here's how the layers look for example.

Group A:
>Group B: Draw Isolated
>> Object 1:: Blend Mode: Screen
>> Object 2:: Blend Mode: Multiply
>> Object 3 :: Blend Mode: Linear Dodge
Object 4
Background

Now, the blend modes of Object 1, 2 and 3 are isolated within the Group B. They don't affect Object 4 which is outside the Group B, but within the Group A. But the objects within Group B are really clipped to Object 4.

You might suggest, well, why not set a blend mode for Group B? That's a different level of blending altogether and does not produce the desired result. When you set a blend mode for Group B, it takes the group as a whole and blends with Object 4. I want the blend modes of Object 1, 2 and 3 to affect the object 4 automatically. This is possible if you set the group blend mode to pass through.

Pass through is a simple and standard blend mode. It's available in most programs.

https://youtu.be/jYrHScr4LjY?t=50 - See the example at the time stamp.

So, the desired state is:

Group A:
>Group B:: Blend Mode: Pass Through
>> Object 1:: Blend Mode: Screen
>> Object 2:: Blend Mode: Multiply
>> Object 3 :: Blend Mode: Linear Dodge
Object 4
Background
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 »

In PhotoLine Clipping Layers and Adjustment Layers in normal Group behave not exactly the same. Adjustment Layers affect all bottom layers outside the group, but Masks don't affect bottom layers outside the group. So perfectly it could be nice to have some "Pass Through" toggle in Layer attributes or in Blending Modes for both of them to operate only within a group or affect all bottom layers outside group too.
Screen Shot 2025-02-11 at 1.02.21 PM.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