Jump to content

Is there any way to not have the transparent residue left by selection tools? I just want a hard edge. This trim was using the rectangular marquee tool without refining, feather at 0px, and anti alias box unchecked.


Recommended Posts

  • Staff
Posted

Welcome to the forums @Josh M.,

With your settings defined on the Marquee selection tool I would expect to see a hard edge selection, and I've not yet been able to produce otherwise other than adding AA/Feathering. Can you share a copy of the .afphoto document with the selection active?

Thanks

Posted

@Josh M. I see your problem. I'm on a Mac M4 running Sequoia 15.3.

If I use your selection, copy and paste to a new layer, then hide the original base layer, I can see some Alpha on either side of pixel 1233. The Alpha to the left of your selection line was A=241, and to the right was A=14. So, the pixels on either side are not pure opaque or pure transparent. I was able to "fix" that with a Curves Layer set to Masking Position, using the Alpha channel, as shown below. However, seems to me that if AntiAliasing is turned off, that shouldn't be happening at all and you should have "0" and "255" alpha on either side of the "hard" selection. Maybe I missed something in the original selection parameters. 

I also tried Refining and turning Matte Edges OFF, but I got the same result. 

Screenshot2025-02-07at8_25_37AM.thumb.jpg.d4efe5f9cc9a5d8f29441a369ac69441.jpg

2024 MacBook Pro M4 Max, 48GB, 1TB SSD, Sequoia OS, Affinity Photo/Designer/Publisher v1 & v2, Adobe CS6 Extended, LightRoom v6, Blender, InkScape, Dell 30" Monitor, Canon PRO-100 Printer, i1 Spectrophotometer, i1Publish, Wacom Intuos 4 PTK-640 graphics tablet, 2TB OWC SSD USB external hard drive.

Posted
33 minutes ago, Ldina said:

@Josh M. I see your problem. I'm on a Mac M4 running Sequoia 15.3.

If I use your selection, copy and paste to a new layer, then hide the original base layer, I can see some Alpha on either side of pixel 1233. The Alpha to the left of your selection line was A=241, and to the right was A=14. So, the pixels on either side are not pure opaque or pure transparent. I was able to "fix" that with a Curves Layer set to Masking Position, using the Alpha channel, as shown below. However, seems to me that if AntiAliasing is turned off, that shouldn't be happening at all and you should have "0" and "255" alpha on either side of the "hard" selection. Maybe I missed something in the original selection parameters. 

I also tried Refining and turning Matte Edges OFF, but I got the same result. 

The strange thing is that if you look through the History, it will cut out cleanly before he does the Invert Pixel selection. After the invert, that is when some alpha values seem to be altered:

 

image.png.0721ebc6d6a14d09167a4071181d5c01.png

 

  • Staff
Posted
5 minutes ago, TrentL said:

The strange thing is that if you look through the History, it will cut out cleanly before he does the Invert Pixel selection. After the invert, that is when some alpha values seem to be altered:

This is unexpected behaviour I've also observed. Creating an entirely new selecting and entering in the same X/Y/W/H dimensions set in the 'Transform Selection' history step will result in this issue only following an invert of the selection area.

Thanks for taking a look @Ldina @TrentL to confirm I've not missed anything obvious. I'll be logging this one with the developers.

Posted

FWIW, I'm not seeing what Trent sees. If I duplicate the selection (CMD-J) BEFORE the Invert step (using the OP's History panel), I still see Alpha channels that are not fully transparent or opaque, but they are simply reversed (i.e., 14 alpha on the left and 241 alpha on the right).

2024 MacBook Pro M4 Max, 48GB, 1TB SSD, Sequoia OS, Affinity Photo/Designer/Publisher v1 & v2, Adobe CS6 Extended, LightRoom v6, Blender, InkScape, Dell 30" Monitor, Canon PRO-100 Printer, i1 Spectrophotometer, i1Publish, Wacom Intuos 4 PTK-640 graphics tablet, 2TB OWC SSD USB external hard drive.

Posted
7 minutes ago, Ldina said:

FWIW, I'm not seeing what Trent sees. If I duplicate the selection (CMD-J) BEFORE the Invert step (using the OP's History panel), I still see Alpha channels that are not fully transparent or opaque, but they are simply reversed (i.e., 14 alpha on the left and 241 alpha on the right).

Yes, I (think) I am seeing the same thing as you. Cutting (CTRL-X) at that point seems clean to me. But duplicating (CTRL-J) or even masking will gives the soft edge result.

Posted
29 minutes ago, NathanC said:

This is unexpected behaviour I've also observed. Creating an entirely new selecting and entering in the same X/Y/W/H dimensions set in the 'Transform Selection' history step will result in this issue only following an invert of the selection area.

Thanks for taking a look @Ldina @TrentL to confirm I've not missed anything obvious. I'll be logging this one with the developers.

So is this a bug? Well, in the meantime, how can I cut cleanly for now? I assume masks, but I'm a beginner, and I'm not too sure.

Posted
1 hour ago, Ldina said:

@Josh M. I see your problem. I'm on a Mac M4 running Sequoia 15.3.

If I use your selection, copy and paste to a new layer, then hide the original base layer, I can see some Alpha on either side of pixel 1233. The Alpha to the left of your selection line was A=241, and to the right was A=14. So, the pixels on either side are not pure opaque or pure transparent. I was able to "fix" that with a Curves Layer set to Masking Position, using the Alpha channel, as shown below. However, seems to me that if AntiAliasing is turned off, that shouldn't be happening at all and you should have "0" and "255" alpha on either side of the "hard" selection. Maybe I missed something in the original selection parameters. 

I also tried Refining and turning Matte Edges OFF, but I got the same result. 

Screenshot2025-02-07at8_25_37AM.thumb.jpg.d4efe5f9cc9a5d8f29441a369ac69441.jpg

Yeah, that's what was confusing me. I didn't make any adjustments to the selections, and it still added alpha values.

image.thumb.png.b5e601ff4fcce00d9ca36e25cc1f851c.pngimage.thumb.png.a3b24f6e075561bcc31e57be08dda3a5.png

Posted
22 minutes ago, Josh M. said:

how can I cut cleanly for now?

See my first post for a workaround, using the Alpha Channel in a Curves Layer. 

2024 MacBook Pro M4 Max, 48GB, 1TB SSD, Sequoia OS, Affinity Photo/Designer/Publisher v1 & v2, Adobe CS6 Extended, LightRoom v6, Blender, InkScape, Dell 30" Monitor, Canon PRO-100 Printer, i1 Spectrophotometer, i1Publish, Wacom Intuos 4 PTK-640 graphics tablet, 2TB OWC SSD USB external hard drive.

Posted
3 hours ago, Ym Eman said:

I missed that. Thanks.

The alpha problem is really hard to reproduce. Does it still happen if you just make a totally new selection and try again? 

Posted
6 minutes ago, TrentL said:

The alpha problem is really hard to reproduce.

Same here, Trent. I started with the OP's base image, eliminated all History to start with a clean slate (just his base pixel layer). Creating a Marquee Selection, no feather, no antialiasing, no refinement. I get a nice hard edge, whether I invert the selection first or not. I used Cmd-J to duplicate the selected portions onto a new pixel layer. 

So, it appears something else may have been done when making the selection, or perhaps there was some glitch in the program, the file, the O/S, etc.

2024 MacBook Pro M4 Max, 48GB, 1TB SSD, Sequoia OS, Affinity Photo/Designer/Publisher v1 & v2, Adobe CS6 Extended, LightRoom v6, Blender, InkScape, Dell 30" Monitor, Canon PRO-100 Printer, i1 Spectrophotometer, i1Publish, Wacom Intuos 4 PTK-640 graphics tablet, 2TB OWC SSD USB external hard drive.

Posted
39 minutes ago, TrentL said:

The alpha problem is really hard to reproduce. Does it still happen if you just make a totally new selection and try again? 

Yes. Maybe its a settings problem? I will record it.

Posted
38 minutes ago, Ym Eman said:

Maybe its a settings problem? I will record it.

I noticed in walking through your History, that you started with a small rectangular selection, then did two transformations, each of which enlarged the original rectangular selection. I'm wondering if that 'enlargement' somehow resulted in feathered edges or something. Try experimenting with that, and if that causes the problem, please let us know. 

When I made my own selection, I did it once, full size, and didn't transform the selection afterwards. I wouldn't think that should introduce any edge transparency.

EDIT: I just tried what I suggested to you. I created an initial selection, no antialiasing, no feather, no refinement. Those edges were sharp. THEN, I transformed the selection (Quickmask Mode, selected the Move Tool, and resized the selection by dragging corners/sides). If you look in the Transform Panel, you will see that it is entirely possible to end up with "fractional pixels" for X/Y, Width or Height, even if you have Force Pixel Alignment active. (I normally set my pixels, in Affinity Settings/Preferences, to 3 decimal points to make the presence of fractional pixels obvious). This appears to be what is creating your semi-transparent edges. 

2024 MacBook Pro M4 Max, 48GB, 1TB SSD, Sequoia OS, Affinity Photo/Designer/Publisher v1 & v2, Adobe CS6 Extended, LightRoom v6, Blender, InkScape, Dell 30" Monitor, Canon PRO-100 Printer, i1 Spectrophotometer, i1Publish, Wacom Intuos 4 PTK-640 graphics tablet, 2TB OWC SSD USB external hard drive.

Posted (edited)
42 minutes ago, Ldina said:

I noticed in walking through your History, that you started with a small rectangular selection, then did two transformations, each of which enlarged the original rectangular selection. I'm wondering if that 'enlargement' somehow resulted in feathered edges or something. Try experimenting with that, and if that causes the problem, please let us know. 

When I made my own selection, I did it once, full size, and didn't transform the selection afterwards. I wouldn't think that should introduce any edge transparency.

EDIT: I just tried what I suggested to you. I created an initial selection, no antialiasing, no feather, no refinement. Those edges were sharp. THEN, I transformed the selection (Quickmask Mode, selected the Move Tool, and resized the selection by dragging corners/sides). If you look in the Transform Panel, you will see that it is entirely possible to end up with "fractional pixels" for X/Y, Width or Height, even if you have Force Pixel Alignment active. (I normally set my pixels, in Affinity Settings/Preferences, to 3 decimal points to make the presence of fractional pixels obvious). This appears to be what is creating your semi-transparent edges. 

Any way to prevent fractional pixels altogether? Also, here's the video replicating the problem.

Edit: Yes, transform was used for accuracy ironically.

Is there a better way to size a selection then? Preferably pixel-accurate?

Edited by Ym Eman
Posted

Like you, I adjusted the selection edges (top, bottom, left and right, individually) in the Transform Panel to make sure I had integers for pixels (with my Pixels set to 3 decimal places in Preferences). I did this after transforming the size, (Quick mask, Move tool, resizing), but when I do a Cmd-J to duplicate the selection, or an inverted selection, I see a 1 pixel wide edge on either side of the original selection that is partially transparent. So, I haven't been successful in retaining a hard edge after transforming a selection (at least with CMD-J). I tried setting the Transform Panel "Scale Override" settings on, and also off. Didn't make any difference. 

The only solution I have found that works, so far, is to use Curves, target the Alpha Channel, and adjust the curve to give me 0 alpha on one edge, and 255 alpha on the other edge. You need to drag that Curves adjustment to the masking position. 

Maybe I am doing something wrong, but if so, I don't know what it is. Transforming a selection and maintaining a hard edge may be a bug. Maybe @NathanC can review what we have done and confirm it is a bug, or show us what we are doing wrong. 

2024 MacBook Pro M4 Max, 48GB, 1TB SSD, Sequoia OS, Affinity Photo/Designer/Publisher v1 & v2, Adobe CS6 Extended, LightRoom v6, Blender, InkScape, Dell 30" Monitor, Canon PRO-100 Printer, i1 Spectrophotometer, i1Publish, Wacom Intuos 4 PTK-640 graphics tablet, 2TB OWC SSD USB external hard drive.

Posted
4 minutes ago, Ldina said:

Like you, I adjusted the selection edges (top, bottom, left and right, individually) in the Transform Panel to make sure I had integers for pixels (with my Pixels set to 3 decimal places in Preferences). I did this after transforming the size, (Quick mask, Move tool, resizing), but when I do a Cmd-J to duplicate the selection, or an inverted selection, I see a 1 pixel wide edge on either side of the original selection that is partially transparent. So, I haven't been successful in retaining a hard edge after transforming a selection (at least with CMD-J). I tried setting the Transform Panel "Scale Override" settings on, and also off. Didn't make any difference. 

The only solution I have found that works, so far, is to use Curves, target the Alpha Channel, and adjust the curve to give me 0 alpha on one edge, and 255 alpha on the other edge. You need to drag that Curves adjustment to the masking position. 

Maybe I am doing something wrong, but if so, I don't know what it is. Transforming a selection and maintaining a hard edge may be a bug. Maybe @NathanC can review what we have done and confirm it is a bug, or show us what we are doing wrong. 

Seems quite tedious to change the alpha channel for every cut, so I don't think that's intentional. Anyway, I will be doing that every time now, I guess.

Posted

I guess it depends on what you are doing. I usually don't require a hard edge when transforming selections, but if you do, it would be a hassle. It doesn't seem to happen for me unless I 'transform' a selection. Maybe Nathan C can weigh in on the subject. 

2024 MacBook Pro M4 Max, 48GB, 1TB SSD, Sequoia OS, Affinity Photo/Designer/Publisher v1 & v2, Adobe CS6 Extended, LightRoom v6, Blender, InkScape, Dell 30" Monitor, Canon PRO-100 Printer, i1 Spectrophotometer, i1Publish, Wacom Intuos 4 PTK-640 graphics tablet, 2TB OWC SSD USB external hard drive.

Posted

In the history panel you can see that the selection was transformed (by move tool or transform panel). This introduces changes in selection dpi and fractional pixel selections at the edges.

Behavior differs a bit between desktop and iPad. On iPad, you can only change selection size when move tool is active, causing this bug. 
on Desktop, you can either modify selection with move tool inactive or active. The latter will cause the issue too, on desktop.

the invert selection does not cause the issue, it just make it noticeably 

 

IMG_2233.png

IMG_2232.png

IMG_2234.png

IMG_2235.png

Mac mini M1 A2348 | MBP M3 

Windows 11 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5 | Dell 27“ 4K

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.

I use iPad screenshots and videos even in the Desktop section of the forum when I expect no relevant difference.

 

Posted
54 minutes ago, Ym Eman said:

Any way to prevent fractional pixels altogether? Also, here's the video replicating the problem.

Yes: activate snapping, force pixel alignment. And never adjust existing selections after creating by moving or stretching.

any movement (except with snapping to whole pixels), any rotation, sheering, scaling (stretching) of pixel layers, mask layers, or selections will cause fractional pixels (even in masks or selections) except you hit perfect integer multiples, and keep the aspect ratio constant.

Mac mini M1 A2348 | MBP M3 

Windows 11 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5 | Dell 27“ 4K

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.

I use iPad screenshots and videos even in the Desktop section of the forum when I expect no relevant difference.

 

Posted

Attached a video showing the adverse effect of stretching selections.

 

Mac mini M1 A2348 | MBP M3 

Windows 11 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5 | Dell 27“ 4K

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.

I use iPad screenshots and videos even in the Desktop section of the forum when I expect no relevant difference.

 

Posted
26 minutes ago, NotMyFault said:

you can either modify selection with move tool inactive or active. The latter will cause the issue too, on desktop.

NMF, I don't understand how you can modify a selection (at least substantially resizing it) with the Move Tool "inactive". Can you explain that please? How else could we modify the size of a selection?

26 minutes ago, NotMyFault said:

This introduces changes in selection dpi

I hadn't noticed this in the context toolbar before, but it does change the dpi...thanks. 

@Ym Eman I did find another workaround. Make you selection, resize as desired with the Move Tool. Then, "Refine" the selection, and choose the options shown below. Turn OFF "Matte Edges" and move all sliders all the way to the left. This gave me a nice hard edge and no semi-transparent areas. 

Screenshot2025-02-07at4_34_46PM.png.d6a48d3cd68f70964be588e914c71b48.png

 

2024 MacBook Pro M4 Max, 48GB, 1TB SSD, Sequoia OS, Affinity Photo/Designer/Publisher v1 & v2, Adobe CS6 Extended, LightRoom v6, Blender, InkScape, Dell 30" Monitor, Canon PRO-100 Printer, i1 Spectrophotometer, i1Publish, Wacom Intuos 4 PTK-640 graphics tablet, 2TB OWC SSD USB external hard drive.

Posted

Never stretch any pixel based artifact (pixel layers, masks, inherent masks, selections) if you need sharp edges and want to resize them. Never.

if you want to get perfect sharp edged selection, use vector shapes as masks, or convert them into selections when the mask is perfect.

Mac mini M1 A2348 | MBP M3 

Windows 11 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5 | Dell 27“ 4K

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.

I use iPad screenshots and videos even in the Desktop section of the forum when I expect no relevant difference.

 

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.