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

Applying mask layer removes image in Affinity Photo


Recommended Posts

Hi 

I want to cut out the background of an image. But when I make a selection with the brush selection tool and click on the mask layer icon, the area I want to keep, becomes transparent. I have spent hours trying to find a solution, but nothing seems to work. I have tried with other images as well, and I get the same result. 

Can you help?

I have attached two images - one before I apply the mask layer, and one after. I hope this helps you identify the issue. 

 

before-applying-mask.png

mask-applied.png

Link to comment
Share on other sites

Menu Selection, Invert selection?

P.S. Selected background is transparent, what's the use of his masks?

Affinity Store (MSI/EXE): Affinity Suite (ADe, APh, APu) 2.4.0.2301
Dell OptiPlex 7060, i5-8500 3.00 GHz, 16 GB, Intel UHD Graphics 630, Dell P2417H 1920 x 1080, Windows 11 Pro, Version 23H2, Build 22631.3155.
Dell Latitude E5570, i5-6440HQ 2.60 GHz, 8 GB, Intel HD Graphics 530, 1920 x 1080, Windows 11 Pro, Version 23H2, Build 22631.3155.
Intel NUC5PGYH, Pentium N3700 2.40 GHz, 8 GB, Intel HD Graphics, EIZO EV2456 1920 x 1200, Windows 10 Pro, Version 21H1, Build 19043.2130.

Link to comment
Share on other sites

22 minutes ago, Pšenda said:

P.S. Selected background is transparent, what's the use of his masks?

Delete the mask layer, then invert the selection and then create a mask.

Just to clarify, you have selected the background, not the macbook?

For the method you used in your post, selecting the macbook and clicking the mask icon in the layers panel would have gotten you what you want.

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

NB: If you have already created a mask, and still have the selection active, delete the selection before inverting the mask. (Otherwise, you only invert the mask within the selection and the whole thing disappears!)

Acer XC-895 : Core i5-10400 Hexa-core 2.90 GHz :  32GB RAM : Intel UHD Graphics 630 : Windows 10 Home
Affinity Publisher 2 : Affinity Photo 2 : Affinity Designer 2 : (latest release versions) on desktop and iPad

Link to comment
Share on other sites

Thanks your replies: 

I tried to delete the mask, invert the selection, and then apply the mask again. Now the macbook remains, but it looks as if it has not been cut out from the background. 

When I try to export the image as a jpeg, the white background is still there. And if I click on the image (including the mask), and copy it to a new document, the background is also there. 

exporting-image.png

copied-to-new-document.png

Link to comment
Share on other sites

5 minutes ago, Mr. Brown said:

When I try to export the image as a jpeg, the white background is still there.

You can't have transparency in a JPEG, use PNG instead.

Acer XC-895 : Core i5-10400 Hexa-core 2.90 GHz :  32GB RAM : Intel UHD Graphics 630 : Windows 10 Home
Affinity Publisher 2 : Affinity Photo 2 : Affinity Designer 2 : (latest release versions) on desktop and iPad

Link to comment
Share on other sites

Your original image is PNG with transparent background? Why don't you use this picture right away, but are you doing some weird background erasing that isn't there anyway (it's transparent) using a mask?

Affinity Store (MSI/EXE): Affinity Suite (ADe, APh, APu) 2.4.0.2301
Dell OptiPlex 7060, i5-8500 3.00 GHz, 16 GB, Intel UHD Graphics 630, Dell P2417H 1920 x 1080, Windows 11 Pro, Version 23H2, Build 22631.3155.
Dell Latitude E5570, i5-6440HQ 2.60 GHz, 8 GB, Intel HD Graphics 530, 1920 x 1080, Windows 11 Pro, Version 23H2, Build 22631.3155.
Intel NUC5PGYH, Pentium N3700 2.40 GHz, 8 GB, Intel HD Graphics, EIZO EV2456 1920 x 1200, Windows 10 Pro, Version 21H1, Build 19043.2130.

Link to comment
Share on other sites

54 minutes ago, Pšenda said:

Your original image is PNG with transparent background? Why don't you use this picture right away, but are you doing some weird background erasing that isn't there anyway (it's transparent) using a mask?

I don't want a background - just the macbook cut out. Below you can see what happens when I try to drag the image around on the canvas. Although I have applied a mask to the mackbook selection, it keeps the background, and leaves behind an imprint of the image. The original image is a PSD file that I then exported as a jpeg file and opened in a new Affinity Photo document because I had the same issue when trying to remove the background in the PSD file. 

moving-image-on-canvas.png

Link to comment
Share on other sites

It looks like you have some sort of feathering on the selection, regardless, it will probably be easier to use a filled curve to mask/clip the image and then crop the extra canvas so that it's a nice tight crop. the beauty about using a curve to mask is it remains easily editable, if you save the file as an afphoto file. 

  1. Select the pen tool and set the stroke to red and width to 0.5pt or 2-3 px Red is good for visibility of the drawn curve.
  2. Start to click around the macbook until you end up where you started, if need be, you can edit the position of the nodes later and add remove nodes to improve the curve clipping
  3. In the colour panel remove the stroke colour and add a black fill
  4. Check the curve layer is above the image, now right-click to select Mask to below
  5. Go to the top menu and click Document > Clip Canvas This will remove any of the extraneous unwanted background.
  6. Now you can refine the nodes to improve the clipping mask.
  7. Export to a format that supports transparency like 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

I'm sorry, but I don't understand what you mean by, " it keeps the background, and leaves behind an imprint of the image". Can you explain what the "issue" is when you remove the background, as it looks like you have already done what you wanted to do, and have removed the background, leaving just the MacBook image!

Acer XC-895 : Core i5-10400 Hexa-core 2.90 GHz :  32GB RAM : Intel UHD Graphics 630 : Windows 10 Home
Affinity Publisher 2 : Affinity Photo 2 : Affinity Designer 2 : (latest release versions) on desktop and iPad

Link to comment
Share on other sites

2 hours ago, Mr. Brown said:

I don't want a background - just the macbook cut out.

That is perhaps clear. But the question is, why do you remove the background from the image when it is no longer there.

Affinity Store (MSI/EXE): Affinity Suite (ADe, APh, APu) 2.4.0.2301
Dell OptiPlex 7060, i5-8500 3.00 GHz, 16 GB, Intel UHD Graphics 630, Dell P2417H 1920 x 1080, Windows 11 Pro, Version 23H2, Build 22631.3155.
Dell Latitude E5570, i5-6440HQ 2.60 GHz, 8 GB, Intel HD Graphics 530, 1920 x 1080, Windows 11 Pro, Version 23H2, Build 22631.3155.
Intel NUC5PGYH, Pentium N3700 2.40 GHz, 8 GB, Intel HD Graphics, EIZO EV2456 1920 x 1200, Windows 10 Pro, Version 21H1, Build 19043.2130.

Link to comment
Share on other sites

On 6/19/2022 at 4:18 PM, firstdefence said:

It looks like you have some sort of feathering on the selection, regardless, it will probably be easier to use a filled curve to mask/clip the image and then crop the extra canvas so that it's a nice tight crop. the beauty about using a curve to mask is it remains easily editable, if you save the file as an afphoto file. 

  1. Select the pen tool and set the stroke to red and width to 0.5pt or 2-3 px Red is good for visibility of the drawn curve.
  2. Start to click around the macbook until you end up where you started, if need be, you can edit the position of the nodes later and add remove nodes to improve the curve clipping
  3. In the colour panel remove the stroke colour and add a black fill
  4. Check the curve layer is above the image, now right-click to select Mask to below
  5. Go to the top menu and click Document > Clip Canvas This will remove any of the extraneous unwanted background.
  6. Now you can refine the nodes to improve the clipping mask.
  7. Export to a format that supports transparency like PNG.

 

 

 

 

Thank you so much for taking the time to record the video! I am very grateful for that. I followed the steps and was finally able to remove the background. Enjoy your day.

Link to comment
Share on other sites

On 6/19/2022 at 4:39 PM, PaulEC said:

I'm sorry, but I don't understand what you mean by, " it keeps the background, and leaves behind an imprint of the image". Can you explain what the "issue" is when you remove the background, as it looks like you have already done what you wanted to do, and have removed the background, leaving just the MacBook image!

The issue was that there was a lot of space around the MacBook (the sides and the bottom), and I wanted to remove that. I hope that makes more sense.

 

On 6/19/2022 at 4:46 PM, Pšenda said:

That is perhaps clear. But the question is, why do you remove the background from the image when it is no longer there.

There is a background - it is just transparent. What I wanted to do was to remove the space around the image, so I had a clean cut of the MacBook without the extra canvas at the bottom and the sides. I hope that makes more sense. 

 

FYI - I have solved the issue now. Thanks for your inputs everyone. 

Link to comment
Share on other sites

3 minutes ago, Mr. Brown said:

The issue was that there was a lot of space around the MacBook (the sides and the bottom), and I wanted to remove that. I hope that makes more sense.

Just for future reference, or for anyone else who may have a similar problem, just go to Document > Clip Canvas.

Acer XC-895 : Core i5-10400 Hexa-core 2.90 GHz :  32GB RAM : Intel UHD Graphics 630 : Windows 10 Home
Affinity Publisher 2 : Affinity Photo 2 : Affinity Designer 2 : (latest release versions) on desktop and iPad

Link to comment
Share on other sites

15 minutes ago, PaulEC said:

Just for future reference, or for anyone else who may have a similar problem, just go to Document > Clip Canvas.

But surely that can only work for a rectangular design, if one is exporting to a raster format?

And this discussion is not about a rectangular design.

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

2 hours ago, walt.farrell said:

But surely that can only work for a rectangular design, if one is exporting to a raster format?

And this discussion is not about a rectangular design.

The discussion was about the OP finding a solution to his problem, although it wasn't immediately apprent what that problem was. Clipping Canvas is relevant to anybody who wishes to remove dead space around an object so the crop is as tight and neat as possible to the extremities of any object.

@PaulEC referencing of Clip Canvas is valid not only because it was the solution that solved the problem but as a clarification of that solution for future readers. The OP mistakenly thought that making a selection around the object would remove the dead space but in our posts he saw that what he really needed to do was Clip Canvas. 

Result is one happy OP :)

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

17 minutes ago, firstdefence said:

Clip Canvas is valid not only because it was the solution that solved the problem but as a clarification of that solution for future readers.

I appreciate it as a clarification, as I don't think anyone actually mentioned that term earlier.

However, my point is that it's not completely a solution for the problem (even if it made the OP happy). The OP started with something like this, and wanted to remove the background (transparent) part:

image.png.4814c9e164dc02b1594d3a3f37d9b62d.png

Clip Canvas will reduce the amount of the transparent background, but it won't remove all of it:

image.png.b0c43d5fd5bbd7a611e7710519ae6920.png

The canvas (and any exported raster image) will still be rectangular, and therefore some of that transparency (as shown by the checkerboard) will remain.

 

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

The original post wasn't explained very well but that's part of the fun in solving the issue, when I made the video and added the Clip Canvas step I think the OP realised what he was trying to do wasn't going to work but the Clip Canvas was the solution he was looking for. I don't think he meant he wanted to. get rid of all the checkerboard, just the checkerboard that was not needed.

But I get where you are coming from.

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

16 hours ago, walt.farrell said:

And this discussion is not about a rectangular design.

The OP (finally) said, "The issue was that there was a lot of space around the MacBook (the sides and the bottom), and I wanted to remove that."

firstdefence is, of course, perfectly correct that, to remove the background completely, the best way is to use a clipping path. However, as the OP had already started working with a mask, and, going on what he said he wanted to achieve, the simplest solution seemed to me to clip the canvas.

It's only fair to add, that although clipping paths are great for comparatively simple shapes and vector objects, they are by no means appropriate in all situations. The picture in question is a raster image and the picture is very simple, making it easy to create a clipping path using the Pen Tool. However, if it had been more complex, a dog with a shaggy coat for example, it could have been difficult, if not impossible, to draw a satisfactory path. Therefore, it seemed reasonable to point out that, the quickest, easiest way to remove the excess transparent area, in this and similar cases, is to use clip to canvas.

Acer XC-895 : Core i5-10400 Hexa-core 2.90 GHz :  32GB RAM : Intel UHD Graphics 630 : Windows 10 Home
Affinity Publisher 2 : Affinity Photo 2 : Affinity Designer 2 : (latest release versions) on desktop and iPad

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.