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

Creating a mask from a black pixel selection/pixel layer (with alpha) - I found an Inconsistency


Recommended Posts

Hi,

First of all, congratulations on the new version 2.3 - again very successful!

There are different ways to create a mask! But the way to create a mask has some inconsistency:

1) I do a selection from a pixel-layer. Then I choose refine. For the output I choose Mask (Mask — applies the refinement to the selection as a mask). OK - and the Refine Selection is doing it right if the selected part was pure black - it creates an inverted mask (because otherwise it would be black in black - so it turns the black-selection into white - and the rest into black).

2) If you have a black pixel layer (with alpha) and then do in the layers panel Rasterize to a Mask - the black part will be black and you end up with a complete "black mask" - this step is not doing the conversion like it is done in the refine selection. You first have to invert the black pixel layer - then you get a mask - that you have to invert again.

3) The third way to do it right would be to select the pixel layer and choose Edit - Matte. Then you can rasterize the Matte to a mask!

mask_layer.afphoto

Link to comment
Share on other sites

1 hour ago, oliver_fuchs said:

2) If you have a black pixel layer (with alpha) and then do in the layers panel Rasterize to a Mask - the black part will be black and you end up with a complete "black mask" - this step is not doing the conversion like it is done in the refine selection. You first have to invert the black pixel layer - then you get a mask - that you have to invert again.

When you use rasterize to mask, only the color of pixels will be used.

transparent areas will be counted as black color, despite transparency is shown as white by default (transparent canvas setting off).

You can see the actual color by using channels panel, and choose one color channel to be visible (but not alpha).

 

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

 

Link to comment
Share on other sites

Hi,

ok ... document is set to transparent background - the object of desire (the thing that should get a mask) is pure evil black. Then the three methods of creating a mask are handling the black object different!

The problem was that I had this black picture and wanted to turn that layer into a mask with rasterizing the layer to a mask - and the result was a pure black screen! Until I realized that the "rasterize to mask" is not inverting a black object before rasterizing while the selection-refine-output mask will do this!

 

Oliver

 

 

 

hree masks form a layer with.jpg

Link to comment
Share on other sites

25 minutes ago, oliver_fuchs said:

Then the three methods of creating a mask are handling the black object different!

Yes, intentionally.

You can create a mask based on either color values, or transparency values. 

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

 

Link to comment
Share on other sites

Hi,

 

ok ... let me see that I understand it correct ... so that means that "rasterize to a mask" grounds on color values. Ah - now I see your point. BUT - in that case the program is producing a wrong result ... it keeps the black and then cannot make the difference anymore between what is black as a color and what is black form the generated mask ... am I right or am I wrong? So you cannot build a mask on a black object when using the rasterize a mask option? Ah - they should change this or add something like in the painting mode "protect alpha" but as "protect black objects"!!!

Thanks

Oliver

Untitled1212.jpg

Link to comment
Share on other sites

I don’t fully get what problem you see.

if you rasterize a pixel layer to mask, black is treated as black, no matter if it comes from from the pixel layer colors or implicitly from background.

the color values are transformed into alpha values. Areas already transparent in the source layer stay transparent in the mask. It is irrelevant what color the canvas, background or any layers below show.

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

 

Link to comment
Share on other sites

12 minutes ago, oliver_fuchs said:

So you cannot build a mask on a black object when using the rasterize a mask option?

A black object will create a mask where nothing is visible when using rasterize to mask.

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

 

Link to comment
Share on other sites

It seem you are still mixing 2 ways of creating a mask:

  • selection from layer: will use only the alpha channel to create a selection, and ignore color values. When creating a mask while this selection is active, you essentially copy the alpha channel.
  • rasterize to mask: converts the color values into alpha values. Ignores the alpha channel, except when alpha is zero colors will be forced zero, too.

https://affinity.help/photo2/en-US.lproj/pages/Selections/selections_fromlayers.html

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

 

Link to comment
Share on other sites

Hi,

ok. ... I do understand this. What was missleading here is the definition of rasterise in the manual: If you rasterise a shape it becomes a pixel layer. It has a clear form ... it has an inside and and outside part. So you also rasterise the shape to a mask ... and I always thought that the main result of this mask is the pure shape - I need a circle maks to hide round parts in my image (or to show them). And I understood the manual in that way that you use " rasterise to a mask" only for shapes! So I thought Affinity takes the black pixel layer like in the example above and rastrises it to a shape equal to the shape of my pixel layer! I thought the result would be the same as in  building a mask from a selection - pure black and white mask! But it dos not. That was my problem! I was missreading the manual!

 

OliverScreenshot2023-12-05214540.png.cada97dfeda2f30da329fa35fa41b803.png 

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.