Jump to content
Our response time is longer than usual currently. We're working to answer users as quickly as possible and thank you for your continued patience.

How to create mask from pixel layer


Recommended Posts

How do I use a pixel layer containing a greyscale image as a layer mask so that white pixels show the current layer and black pixels hide the current layer, and grey shades in between represent partial transparancy?

In the screenshot (attached) I want to use the black and white picture of the skull to mask the green square so that I end up with a green skull where the white is, and the black are would be transparent. any grey pixels would be different levels of transparancy.

I really need step by step instructions as I just don't understand how to do this in AP as I am so used to doing it in Adobe Photoshop.

Thanks

ap-masks.jpg

Link to comment
Share on other sites

Go to the Layers panel, right-click the skull layer and choose ‘Mask to Below’ from the context menu.

Alfred spacer.png
Affinity Designer/Photo/Publisher for Windows 1.10 • Windows 10 Home/Pro
Affinity Photo for iPad 1.10 • Designer for iPad 1.10 • iPadOS 15.6.1 (iPad Air 2)

Link to comment
Share on other sites

17 minutes ago, Alfred said:

Go to the Layers panel, right-click the skull layer and choose ‘Mask to Below’ from the context menu.

Hi, thanks but I tried that and it doesn't acheive what I am after. Instead it results in a green square instead of a green skull (see attachment).

I suspect I either need to do something with channels or to create a selection from the greyscale image but cannot find how to do that :-(

ap-masks2.jpg

Link to comment
Share on other sites

2 minutes ago, toltec said:

I would invert the skull layer to make the skull black. Layer > Invert

skull1.jpg.01e61a82ba334c9d8e22d5bc710eb831.jpg

 

Put the green on top and change the Layer blend mode to screen

screen.png.abd1182e22d6457e5ddd35aaede542a0.png

skull.jpg.418bee198b6cb642dbe4a03a5e550cc7.jpg

Thank you - but that only solves part of my problem. I also need any pixels that are white in the example photo you attached to be transparent so that the green skull can be placed on a different colour background or over a photograph. Any thoughts on how that can be done? I'm so used to using Adobe Photoshop and it is fairly simple in that as I simply paste the greyscale image on to the layer mask (something that I don't seem to be able to do in Affinity Photo)

Link to comment
Share on other sites

Yes, sorry, I realised that just after posting.

 

Invert the skull layer to make the skull black. Layer > Invert

 

On the black skull layer, go Filter > Colours > Erase White Paper.

 

Nest the green layer (no need to use a blend mode, just drag it to the nesting position which is below and to the right of the thumbnail 

 

Nesting position

nesting.png.613ee8e11e22e9cd9fd13d2bf407347a.png

 

Nested

nest.png.2914655c5bb4eb654514e84c64b94374.png

 

skull3.png.b88fe8abd189a0a85275189a36e01497.png

 

Looks slightly messy because i only had a small screenshot. Your image should be fine.

Windows PCs. Photo and Designer, latest non-beta versions.

Link to comment
Share on other sites

I managed to find the solution that does both for me!

1) I selected the skull image

2) Clicked on Layer > Rasterise to Mask

3) dragged the new skull/mask layer underneath the green layer so it became the layer mask

4) placed a photo behine the skull

Now my skull is green and the white is transparant.

Thanks everyone for your suggestions.

ap-masks3.jpg

Link to comment
Share on other sites

3 minutes ago, toltec said:

Yes, sorry, I realised that just after posting.

On the black skull layer, go Filter > Colours > Erase White Paper.

Nest the green layer (no need to use a blend mode, just drag it to the nesting position

which is below and to the right of the thumbnail 

Looks slightly messy because i only had a small screenshot. Your image should be fine.

Thanks toltec - your method appears to result in exactly the same thing as the 'convert layer to mask'. Thanks for sharing I had no idea that was a feature.

Link to comment
Share on other sites

1 hour ago, Alfred said:

Go to the Layers panel, right-click the skull layer and choose ‘Mask to Below’ from the context menu.

 

1 hour ago, Rob123456789 said:

Hi, thanks but I tried that and it doesn't acheive what I am after. Instead it results in a green square instead of a green skull (see attachment).

 

Sorry about that! As you've discovered, I should have said 'Rasterize to Mask' instead of 'Mask to Below' (and you need to nest the mask layer inside the green layer so that it doesn't mask out the background image).

Alfred spacer.png
Affinity Designer/Photo/Publisher for Windows 1.10 • Windows 10 Home/Pro
Affinity Photo for iPad 1.10 • Designer for iPad 1.10 • iPadOS 15.6.1 (iPad Air 2)

Link to comment
Share on other sites

  • 4 months later...
On 11/11/2017 at 2:56 PM, Rob123456789 said:

I managed to find the solution that does both for me!

1) I selected the skull image

2) Clicked on Layer > Rasterise to Mask

3) dragged the new skull/mask layer underneath the green layer so it became the layer mask

4) placed a photo behine the skull

Now my skull is green and the white is transparant.

Thanks everyone for your suggestions.

ap-masks3.jpg

This is exactly what I needed. This magical option "Layer > Rasterise to Mask" that I didn't know

 

 

 

 

 

Link to comment
Share on other sites

  • 2 years later...
  • 7 months later...

I have to say that whilst being an enthusiastic swapper from Adobe after Many years, I am really struggling with the Affinity masking scenario. I would really appreciate a definitive (even a "made for idiots" mentality) video to get all this clear in my mind. Even something that especially matters for people making the switch. Along the lines of "you know how you used to do this, well now you achieve that by doing this instead". I think a great deal more could be achieved by referencing the old ways whilst education on the new. The videos I have seen so far are slow, stale and not up to scratch, using elements that confuse the issue, rather than showing the mechanics.

Link to comment
Share on other sites

  • 1 month later...
On 2/28/2021 at 2:03 PM, atomic101 said:

I have to say that whilst being an enthusiastic swapper from Adobe after Many years, I am really struggling with the Affinity masking scenario. I would really appreciate a definitive (even a "made for idiots" mentality) video to get all this clear in my mind. Even something that especially matters for people making the switch. Along the lines of "you know how you used to do this, well now you achieve that by doing this instead". I think a great deal more could be achieved by referencing the old ways whilst education on the new. The videos I have seen so far are slow, stale and not up to scratch, using elements that confuse the issue, rather than showing the mechanics.

atomic, I'm completely with you here – I don't know why, but even as an experienced user of many desktop design apps over more than 20 years I find myself struggling, too, with some aspects of the way the Affinity apps handle masking.

How I wanted to continue:

What on earth is so difficult to implement here, that for a start I cannot simply create or assign a mask (or mask layer or whatever you may call it) to any object, group or layer and then paint with black and white (or grey, for that) on that mask (or put greyscale objects on that mask) with the simple effect that "white reveals, black conceals" as it has been for ages by now??? Any idiot can understand that after doing it twice, I'd say.
Masking in Affinity, however, it obviously doesn't matter at all which colour you use while painting in a mask – ANY colour will conceal and you have change tools (to the Eraser Tool) to reveal parts you have accidentally hidden/concealed. This is SO unergonomic!

BUT:

All of a sudden – as I try to check again – it works exactly as you should expect!!! WTF is going on here? So: create an object, choose "Mask Layer" (button at the bottom of the Layers Panel) and you get a mask below the object where you can paint with black to conceal and overpaint with white to reveal again! Obviously this mask it's strictly some kind of a Pixel Layer and you cannot put any vector objects on it like you can in Illustrator (but then again you can't paint with pixels in Illustrator...). So you might say it's not better or worse as in Illustrator but just different...

On the other hand: Where it gets weird IMHO is when you put another vector object above the one you want to mask and choose "Mask to below" via the context menu of the topmost object: quite contrary to at least my expectations what remains visible is just the overlapping area of the two objects and not what's NOT covered by the object you wanted to use to mask (partially hide) the object below with (intuitively I'd expect it to work exactly the other way round). And the colour of that top object doesn't matter at all... (Its transparency – if it's got some – does, however!)

So if you want to hide/mask something by using vector objects you're forced to think not: "What do I want to hide?" but "What shall remain visible?" and then create the necessary objects accordingly...

Anyway, some aspects still don't feel quite natural to me and I can only hope I'll really wrap my mind around it one day...

Link to comment
Share on other sites

  • Moderators

Hi Lorox,
When you put the second vector object above the first and select Mask to Below you are using a shape as a vector mask. Vector masks do use the transparency to mask the objects they are well ...masking, while raster based masks (the one you created clicking the Mask Layer button on the bottom of the Layers panel) use the  greyscale values (black conceals /white reveals) to mask the objects. Notice the different icons on their thumbnails: a raster based mask has a small grey circle, while vector based masks have a small crop icon.

Link to comment
Share on other sites

4 minutes ago, MEB said:

Hi Lorox,
When you put the second vector object above the first and select Mask to Below you are using a shape as a vector mask. Vector masks do use the transparency to mask the objects they are masking, while raster based masks (the one you created clicking the Mask Layer button on the bottom of the Layers panel) do use greyscale values (black conceals /white reveals) to mask the objects. Notice the different icons on their thumbnails: a raster based mask has a small grey circle, while vector based masks have a small crop icon.

Thanks MEB,

I think I figured that out by now, but – to me at least – it's irritating nevertheless.

And well, with vector masks you can actually do some interesting things when you add the "Erase" mode to the equation – as I seem to have found out. However there always seems to be some sort of very thin visible "seam" on the edges of the area where objects set to "Erase" border to those of regular visibility. This effectively lets me hesitate to use the feature so far...
Maybe I have to try again but with v1.5 I think these "seams" even made their way into exported pixel formats. This seemed to indicate that these artefacts weren't just display glitches but rendering problems on an object basis.

 

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...
 Share

×
×
  • Create New...

Important Information

Please note there is currently a delay in replying to some post. See pinned thread in the Questions forum. These are the Terms of Use you will be asked to agree to if you join the forum. | 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.