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

Selection Maths in Affinity Photo - how is it done


Recommended Posts

11 minutes ago, >|< said:

more than two levels of selection - for example, 256 in an 8 bpc document and 65536 in a 16 bpc document.

I think the pixel selection has only two states - "selected" and "unselected".
Depending on the bit depth of the image, it is then possible to control the "intensity" (or strength) of the selection.

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

6 minutes ago, >|< said:

Unselected is the minimum level of selection, fully-selected is the maximum, but there are many levels between the two extremes.

Yes, but:
- Unselected pixel is zero (0%) selection intensity,
- Selected pixel is non zero (0.000001 - 100%) selection intensity.

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

5 minutes ago, Pšenda said:

I think the pixel selection has only two states - "selected" and "unselected".
Depending on the bit depth of the image, it is then possible to control the "intensity" (or strength) of the selection.

There are indeed only those two states for the pixels of a document. The properties of each pixel (for example its RGB or HSL color values or its opacity) is a different thing, whether they are selected or not.

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

2 hours ago, R C-R said:

I don't understand what you mean by pixels at the same relative positions in both documents. Relative to what? When I do as you suggest, the new document is not the same size as the original, nor are any of its pixels at the same coordinates relative to the origin of the original.

OK, try this:

1. Create a new image.

2. Fill the canvas with a fully opaque colour of your choice.

3. Make the largest possible elliptical selection.

4. Cut the selection.

5. Choose ‘New from Clipboard’.

The new image will be the same size as the original and the two images will have no pixels in common. All of the coloured pixels in both images will still be fully opaque.

Repeat the procedure, but add an extra step after step 3:

3a. Feather the selection.

Now when you perform step 4, the edge of the elliptical hole will have semi-opaque pixels. When you perform step 5, the new copy of the ellipse will also have semi-opaque pixels at the same pixel positions as the original image (such that, for example, a 65% opaque pixel in one image will be 35% opaque in the other image).

Still clear as mud? :/

Alfred spacer.png
Affinity Designer/Photo/Publisher 2 for Windows • Windows 10 Home/Pro
Affinity Designer/Photo/Publisher 2 for iPad • iPadOS 17.4.1 (iPad 7th gen)

Link to comment
Share on other sites

On 10/15/2018 at 10:33 AM, R C-R said:

But each pixel is either selected or it is not selected.

This is what I  am referring to when I say that a selection is a more abstract concept than a mask.  A seletion can have a fuzzy edge becase of feathering. The pixels in the feathered region are partially selected. The software applies an appropriate feathering algorithm to decide how such pixels are applied. Not a straightforward selected or not selected.

A mask can have a fuzzy edge for any number of reasons. In a mask any pixel csn have a (monochrome) value between zero and 255 (for 8-bit masks).1

John

Windows 10, Affinity Photo 1.10.5 Designer 1.10.5 and Publisher 1.10.5 (mainly Photo), now ex-Adobe CC

CPU: AMD A6-3670. RAM: 16 GB DDR3 @ 666MHz, Graphics: 2047MB NVIDIA GeForce GT 630

Link to comment
Share on other sites

18 minutes ago, John Rostron said:

The pixels in the feathered region are partially selected.

I think I would  say that they are:

  1. Fully selected; but
  2. May have transparency added; and
  3. The pixels that have transparency added may be in both the inside part of the selection and  the outside part. That is, with feathering, the boundary is diffuse and a pixel may be in both regions, which are no longer 100% disjoint.

An individual pixel can't be "partially selected" as a pixel is an indivisible atomic object. (However, I'm not sure that helps with the math question.)

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

20 minutes ago, walt.farrell said:

I think I would  say that they are:

  1. Fully selected; but
  2. May have transparency added; and
  3. The pixels that have transparency added may be in both the inside part of the selection and  the outside part. That is, with feathering, the boundary is diffuse and a pixel may be in both regions, which are no longer 100% disjoint.

This is why I referred to it as an abstract concept. You propose an interpretation or model that works for you. 

John

Windows 10, Affinity Photo 1.10.5 Designer 1.10.5 and Publisher 1.10.5 (mainly Photo), now ex-Adobe CC

CPU: AMD A6-3670. RAM: 16 GB DDR3 @ 666MHz, Graphics: 2047MB NVIDIA GeForce GT 630

Link to comment
Share on other sites

18 minutes ago, αℓƒяє∂ said:

The new image will be the same size as the original and the two images will have no pixels in common. All of the pixels in both images will still be fully opaque.

Perhaps I misunderstood how to do something, but all of the pixels in the new document are not fully transparent, regardless of if I include step 3a or not. I am doing this in Affinity Photo, if that makes any difference, so I can use Select > Alpha Range > Select Partially Transparent. Either with or without the extra step, this selects some of the pixels. I don't know if this is a bug or what, because without step 3.a it certainly looks like all the pixels are either fully opaque or fully transparent. O.o

But regardless of that weirdness, the end result of making a selection (feathered or not) & doing anything to it (painting, adjusting, filtering, whatever) is each pixel has just one set of color & opacity properties -- there are no partially filled or colored pixels & each one has just one opacity value. It cannot be otherwise, even if some of the things (like feathering) that can be done use sub-pixel sampling, because that is the nature of a pixel, & it does not change regardless of the selection method, which is always a separate step from whatever follows & is always a yes or no, selected or not process.

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

2 minutes ago, >|< said:

Your erroneous position throughout this argument has been that selections are boolean because a selection pixel can have one of only two possible values representing selected and unselected, which is false.

That is not my position. It is that making a selection is a boolean operation because a document's pixels can have only one of two selection states as a result of that operation, selected or not selected. It is not about the bit values of any one "selection pixel." It is about the selection state of all the pixels in the document.

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

2 minutes ago, >|< said:

You've gone off on a tangent. Now you are talking about merely distinguishing between whether there is no pixel selected or at least one pixel selected, with no regard for the specific state of each pixel. What on earth has that got to do with the subject of this thread - the mathematics of Affinity's addition, subtraction and intersection of selections?

1. This is not a new or different tangent. It is what I have been saying since my first post on the subject.

2. It has everything to do with the mathematics of making selections, & then adding, subtracting or intersecting them. How could it not?

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

5 hours ago, R C-R said:

without step 3.a it certainly looks like all the pixels are either fully opaque or fully transparent. O.o

Because of antialiasing, even without step 3a you will have some edge pixels which look like they’re a different colour (e.g. pink if the original fill colour is red) but they will actually be semitransparent.

Quote

But regardless of that weirdness, the end result of making a selection (feathered or not) & doing anything to it (painting, adjusting, filtering, whatever) is each pixel has just one set of color & opacity properties -- there are no partially filled or colored pixels & each one has just one opacity value.

No one is suggesting that any pixels are only partially filled or partially coloured. In the scenario I tried to describe earlier, some pixels are completely opaque, some are completely transparent and the ones at the interface between those two regions have the same fill colour as the fully opaque pixels but their semitransparency makes them look paler.

Alfred spacer.png
Affinity Designer/Photo/Publisher 2 for Windows • Windows 10 Home/Pro
Affinity Designer/Photo/Publisher 2 for iPad • iPadOS 17.4.1 (iPad 7th gen)

Link to comment
Share on other sites

4 hours ago, αℓƒяє∂ said:

Because of antialiasing, even without step 3a you will have some edge pixels which look like they’re a different colour (e.g. pink if the original fill colour is red) but they will actually be semitransparent.

That is the opposite of what it looks like on my Mac without step 3.a. Literally, all the pixels look like they are either completely opaque or completely transparent -- there is only one color, exactly the same color as the original red, & nothing that looks pink. What is strangest is if I select by alpha range, both Select Fully Transparent & Select Partially Transparent show exactly the same selections. The new from clipboard document has a transparent background. If I then use (for example) the Flood Fill Tool to fill either of those selections with a different color, I still get just two colors, & then neither of those alpha selections selects any pixels -- all pixels are thus then fully opaque.

All this is according to what the Affinity Photo alpha selections tell me.

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

4 hours ago, >|< said:

How do you think the software can calculate the intersection, addition or subtraction of a pair of pixel selections without regarding the selection states of each corresponding pair of pixels of the selections?

How do you think it does that in the example I mentioned many posts ago when the document has no layers? It is easy enough to show that it does in this case, even though no pixel has any attribute other than selected or not selected.

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

4 hours ago, >|< said:

You'll never understand what's happening until you rid yourself of the misconception that the pixels of a selection are boolean in nature.

I do not understand why even now you still think that is what I have been saying. I am talking about the spacial geometric property of a document's pixels either being selected or not being selected, not about the color or opacity values of those pixels.

I thought that would be self-evident from the fact that a pixel selection is independent of the contents of any of a document's layers, & that pixel selections can be made, added, subtracted, or intersected even when a document has no layers or they are all deleted.

And selections certainly are not interchangeable with masks, alpha channels, etc.

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

2 hours ago, R C-R said:

I am talking about the spacial [sic] geometric property of a document's pixels either being selected or not being selected

If selection is ‘all or nothing’, how do you explain the fact that cutting a feathered selection leaves behind some coloured pixels within the selection outline? :/

Alfred spacer.png
Affinity Designer/Photo/Publisher 2 for Windows • Windows 10 Home/Pro
Affinity Designer/Photo/Publisher 2 for iPad • iPadOS 17.4.1 (iPad 7th gen)

Link to comment
Share on other sites

4 minutes ago, αℓƒяє∂ said:

If selection is ‘all or nothing’, how do you explain the fact that cutting a feathered selection leaves behind some coloured pixels within the selection outline? :/

Feathering is a separate process from making pixel selections: first you make a pixel selection & only then can you feather it. You can do this even when there are no colored pixels to leave behind or no layers in the document.

BTW, I wrote "spacial" to emphasize this is a property of the 2D space of the document.

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

9 minutes ago, R C-R said:

Feathering is a separate process from making pixel selections: first you make a pixel selection & only then can you feather it.

Regardless of whether you make a feathered selection in a single step or make a solid selection and subsequently feather it, the fact remains that the pixels within the affected area end up being neither fully selected nor fully unselected.

Alfred spacer.png
Affinity Designer/Photo/Publisher 2 for Windows • Windows 10 Home/Pro
Affinity Designer/Photo/Publisher 2 for iPad • iPadOS 17.4.1 (iPad 7th gen)

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.