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

Help needed with precise mask layer


Recommended Posts

Help, I am a newbie with Affinity. I have a rendered picture and a a very precise mask picture generated by a render engine. Both are in .PNG format. I'd like to use the mask file to mask out the black background and make the background transparent on the picture image so that I can overlay the image onto a new scene file? Can someone help me with step by step procedures? Thank you very much for any help provided.

Link to comment
Share on other sites

Open the main image, and drag and drop the mask image into the main image, make the mask image a child of the main image and change the mask image layers blend mode to erase.

Should look something like this in the Layers panel.
1884151611_ScreenShot2018-09-15at23_23_07.png.fb4c58076b99887f36918fc5abc091c6.png


 

iMac 27" 2019 Somona 14.3.1, iMac 27" Affinity Designer, Photo & Publisher V1 & V2, Adobe, Inkscape, Vectorstyler, Blender, C4D, Sketchup + more... XP-Pen Artist-22E, - iPad Pro 12.9  
B| (Please refrain from licking the screen while using this forum)

Affinity Help - Affinity Desktop Tutorials - Feedback - FAQ - most asked questions

Link to comment
Share on other sites

firstdefence,

 

Thank you for the reply. However, here's what I am trying to do. As part of my render objects, I have two files: the Image file (.png) with a black background and a mask file (.png). I'd like to use the mask file to mask off the black background of the image file. The mask area should be transparent so that I can save the masked off image as an object file then I can paste the object into a final scene file. Here's an example of the files:

I am so frustrated for not being able to do such a simple operation! Thank you in advance for any assistance anyone can provide.

 

The 6 Lights Test Dk Bg - Flake n Pearly carpaint.png

The 6 Lights Test Dk Bg - Flake n Pearly carpaint_alpha.png

Link to comment
Share on other sites

Thank for the reply. However, I am quite dense. Here are my step by step procedures and I am not getting the desired results.

1. Launch Aiffinity

2. from File menu> Open...Load image file

3. From Layer menu> New Mask Layer ( the mask layer appears BELOW the image layer)

4. From the mask layer (a white screen)...edit Mask Layer

5. From File menu>Place...load mask file

6. Paste across screen

7. From Layer..Rasterize...

The net result is the same original image without masking...what did I do wrong? It seems so crude and cumbersome without the desired result. Can you provide the step by step instructions? I am quite dense when it comes to photo editing. Thank you in advance for any assistance provided.

 

image.png

Link to comment
Share on other sites

20 minutes ago, TPham said:

7. From Layer..Rasterize...

I think that GabrielM suggested Layer > Rasterize to Mask, not using Layer > Rasterize... or Rasterize... from the Layers panel

rasterize.png.f75266cf07a9b53f8b278b8f20e8d186.png

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

1 hour ago, TPham said:

1. Launch Aiffinity

2. from File menu> Open...Load image file

3. From Layer menu> New Mask Layer ( the mask layer appears BELOW the image layer)

4. From the mask layer (a white screen)...edit Mask Layer

5. From File menu>Place...load mask file

6. Paste across screen

7. From Layer..Rasterize...

Far too many steps and some are wrong and why are you creating a new mask layer when you already have a mask image ?

1 Load Image

2 Load Mask Image (i.e. File > Place)

3 Position it. Use snapping (the magnet) to position it exactly.

4 Layer > Rasterise to Mask 

masked.jpg.ffa266cc2fa5e507a42619d6c2e67f2e.jpg

There is a big difference between Rasterise and Rasterise to Mask.

 

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

Link to comment
Share on other sites

4 hours ago, TPham said:

Wow, sometimes things that are small trivial and obvious to you could be a big deal to others. Thank you, finally I can create a precise mask! May I ask how to save the object and past it onto another scene file?

You can export it, File > Export... (⌘+E)  and export it to a file type that supports transparency i.e. PNG

Do you want to crop to the object?

If yes, you can Cmd+ click (Ctrl+Click on Win) on the Mask layer, this will show a selection and the marching ants, from here you can do copy cmd/ctrl + C and then File > New from clipboard which will create a new document that is neatly cropped to the object.

As a side note, have you noticed you have a faint line on the left side of the object, I'm assuming from how bubbly and smooth the object is, that it isn't supposed to be there? 

623513510_ScreenShot2018-09-19at07_15_41.png.ef1f166d5bfcf918cce510e445861e37.png

iMac 27" 2019 Somona 14.3.1, iMac 27" Affinity Designer, Photo & Publisher V1 & V2, Adobe, Inkscape, Vectorstyler, Blender, C4D, Sketchup + more... XP-Pen Artist-22E, - iPad Pro 12.9  
B| (Please refrain from licking the screen while using this forum)

Affinity Help - Affinity Desktop Tutorials - Feedback - FAQ - most asked questions

Link to comment
Share on other sites

firstdefence, toltec, et al.,

 

Thank you very much for your patience. As you already have seen, I am extremely novice at this. As far as the faint line goes, I think it is because of the shadow from the light casting from the right emitter? This is a paint test image so I did not run the render very long. The final production image will certain have a much better resolution, hopefully, won't have the same artifact. Would you believe that this is the first time that I've tried to edit a picture in earnest beside the basic cropping to fit using MS Paint? My next task is to create a new document of the cropped image then paste it onto the final scene image, so your advice above was spot on. Thank you again for talking to me like talking to a first grader, I am very grateful for the detail advises. You have certainly put me onto the right path with the new image editing skill set.

Link to comment
Share on other sites

Try CTRL Clicking on the layer's Thumbnail not where the text is

To save time I am currently using an automated AI to reply to some posts on this forum. If any of "my" posts are wrong or appear to be total b*ll*cks they are the ones generated by the AI. If correct they were probably mine. I apologise for any mistakes made by my AI - I'm sure it will improve with time.

Link to comment
Share on other sites

7 minutes ago, TPham said:

firstdefence,

 

Would you mind helping me again? I <Control>clicked of the mask layer and tried to create a selection but I did not see the fire ants! This is  what I saw...no fire ants...no selection...sigh..what did I do wrong?

 

Make sure you Ctrl + click on the Mask Layer thumbnail, not the name.

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

Link to comment
Share on other sites

<Ctrl>+ Mask Layer "thumbnail". Ok, that's a huge difference. One more question if you tolerate my ignorance, is there another way to overlay the mask file precisely instead of using <File>Place..> command? Despite my effort to set the snap settings in the magnet button, I am not able to snap the mask precisely onto the desired image area. Sometimes, it fit precisely often times, I would miss by a pixel or two, thus, having a thin black line one pixel wide at the edge boundary. If both of my image and mask files are generated by the render engine, I should just align at the top left edge then the overlay mask will be precisely applied onto the image. <File>Place...> command seems like a hit and miss approach...Is there a better way? Thank you in advance for your time.

Link to comment
Share on other sites

  • Staff

Try this: 

  • File > Open. Select both files. This will create 2 windows/documents. 
  • Copy the image layer from one document. Move to the other document and Paste. This will place it in place - if they both have the same dimensions, they will be perfectly aligned.
  • Arrange them in the layer stack with the mask on the top, and the beauty pass on the bottom. Select the mask image, go to Layer > Rasterise to Mask 
Link to comment
Share on other sites

26 minutes ago, GabrielM said:

Try this: 

  • File > Open. Select both files. This will create 2 windows/documents. 

Out of curiosity, is there any advantage to that over using Snapping and aligning the placed image to the page edges?

 

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

Link to comment
Share on other sites

Id just drag the mask in and adjust the position in the transform panel, you can't really get it wrong from there if the mask and image are the same size.

Having just said all of that it would be wise to have Move by whole pixels turned off in snapping wouldn't it? 

iMac 27" 2019 Somona 14.3.1, iMac 27" Affinity Designer, Photo & Publisher V1 & V2, Adobe, Inkscape, Vectorstyler, Blender, C4D, Sketchup + more... XP-Pen Artist-22E, - iPad Pro 12.9  
B| (Please refrain from licking the screen while using this forum)

Affinity Help - Affinity Desktop Tutorials - Feedback - FAQ - most asked questions

Link to comment
Share on other sites

If you having snapping on and in particular Snap to spread plus its sub option: Include spread mid points you can use the Place option: File > Place with perfect accuracy.

A small tip is when placing an image press <Ctrl> down on Mac (it may be the same on windows) to see the image to be placed and also to snap to the document bounds. Just found this little tip while trying to get a screengrab.

iMac 27" 2019 Somona 14.3.1, iMac 27" Affinity Designer, Photo & Publisher V1 & V2, Adobe, Inkscape, Vectorstyler, Blender, C4D, Sketchup + more... XP-Pen Artist-22E, - iPad Pro 12.9  
B| (Please refrain from licking the screen while using this forum)

Affinity Help - Affinity Desktop Tutorials - Feedback - FAQ - most asked questions

Link to comment
Share on other sites

GabrielM and firstdefence,

I would have posted the result sooner but I wanted to try out both approaches and on multiple files to see if I can repeatedly obtained the desired results. It seems like GabrielM's approach works very well:

"Try this: 

  • File > Open. Select both files. This will create 2 windows/documents. 
  • Copy the image layer from one document. Move to the other document and Paste. This will place it in place - if they both have the same dimensions, they will be perfectly aligned.
  • Arrange them in the layer stack with the mask on the top, and the beauty pass on the bottom. Select the mask image, go to Layer > Rasterise to Mask "

Thank you all just the same for helping me. I consider this the very best of internet...a few peoples willing to spend time and patiently help a complete stranger! Thank you! I hope someday I will be able to do the same helping complete strangers with my meager skill set.

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.