Jump to content

Recommended Posts

Posted

Hey all,

I'm trialing Affinity and I seem to have gotten hung up on a simple image resizing action. Reading through the forums I saw to make sure you have "force pixel alignment" enabled which seems to have been the default but I'm still not having any luck. What I'm doing:

  1. Opening a large image (86400x43200, tif)
  2. Resizing the document to 4320x2160 (unlocked just in case locked forces subpixel resizing) with resampling enabled using lanczos
  3. Selecting a 3840x2160 portion of the image (Antialias is unchecked on the selection and feather is set to 0 px) and copying it
    Note: this is done by creating a selection then manually editing the "Transform" dialog to X: 165, Y: 0, W: 3840, H: 2160
  4. Creating from clipboard from the copied selection
    Note: the created document is for some reason bigger than the copied selection
  5. Exporting as PNG

At step 4 I can't seem to get away from a transparently feathered edge around the border of the document and I have no idea why. I've attached both the downscaled source and the image created from the crop in the clipboard. The source image is too large to attach (>2 GB)

 

Earth-downscaled.png

Crop-From-Clipboard.png

Posted

Welcome to the forums @zamadatix

The first thing you can check is to see whether the numbers in the Transform Panel are really integers.
Even though you have “Force Pixel Alignment” switched on there can be times when this isn’t true.
Go to Preferences / User Interface and set all the Decimal Places values to their maximum values (you can reduce them later if necessary).
Close the dialog and have a look at the Transform Panel values when the image layer is selected.

Also, can you confirm that you are using Affinity Photo and not one of the other Affinity applications?

Posted
13 hours ago, zamadatix said:

3. Selecting a 3840x2160 portion of the image (Antialias is unchecked on the selection and feather is set to 0 px) and copying it
Note: this is done by creating a selection then manually editing the "Transform" dialog to X: 165, Y: 0, W: 3840, H: 2160


This step is where the problem lies.  When transforming or resizing a selection in Affinity Photo, it will soften the edges (even though you have antialias and feather turned off).  It's not just when creating a new document from clipboard, creating a mask from the selection will have the same problem (see below).  It's a PITA.

Screenshot A:

2102586253_ScreenshotA.thumb.png.3d5fcb3024ce5bca5562b8efd9752b70.png

Screenshot B:

2019558326_ScreenshotB.thumb.png.ed2bcbf6bd2bf632a74293b0599af582.png

 

Although obviously not ideal, you would need use the Rectangle tool instead of the Marquee tool to create selections in this way and retain the sharp edge.  [CMD/CTRL + left click] on the rectangle layer icon in the layers panel will create a selection from the rectangle shape (the fill opacity of the rectangle will need to be put back from 0% to 100% opacity before creating the selection).

In your case though, depending on what you're doing, it will likely be better to create a document at the correct final dimensions (3840×2160) and place the original image straight into that document, where you can then move it around and resize it.

 

Posted
1 hour ago, - S - said:


This step is where the problem lies.  When transforming or resizing a selection in Affinity Photo, it will soften the edges (even though you have antialias and feather turned off).  It's not just when creating a new document from clipboard, creating a mask from the selection will have the same problem (see below).  It's a PITA.

Screenshot A:

2102586253_ScreenshotA.thumb.png.3d5fcb3024ce5bca5562b8efd9752b70.png

Screenshot B:

2019558326_ScreenshotB.thumb.png.ed2bcbf6bd2bf632a74293b0599af582.png

 

Although obviously not ideal, you would need use the Rectangle tool instead of the Marquee tool to create selections in this way and retain the sharp edge.  [CMD/CTRL + left click] on the rectangle layer icon in the layers panel will create a selection from the rectangle shape (the fill opacity of the rectangle will need to be put back from 0% to 100% opacity before creating the selection).

In your case though, depending on what you're doing, it will likely be better to create a document at the correct final dimensions (3840×2160) and place the original image straight into that document, where you can then move it around and resize it.

 

Well, that is certainly unique! Thanks this works, albeit awkwardly as you say. 

Posted
3 hours ago, - S - said:

When transforming or resizing a selection in Affinity Photo, it will soften the edges (even though you have antialias and feather turned off).

This is a consequence of the underlaying algorithms used to handle layers: it will always/continuously resample the document layers to the canvas. If you resize a layer, this almost always creates a blurry edge, as the edge pixels (visible canvas) will be resample from multiple document pixels. Only  integer multiple / fractions could deliver sharp edges - with additional constraints.

To keep sharp edges, better export with new size and import back again, or use document-resize. Then you have at least full control which resample method is used. If you simply resize a layer inside a document, it is always bilinear or nearest neighbor (depending von performance settings). 
 

The handling of layers and resampling is one of the most mis-understood features.

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

The rectangle method works but I find that a pain and prefer using the marquee. It's certainly possible although you'll need a sense of humour
So:
Create the marquee
Resize with the transform panel
Add a pixel layer
Fill with white
Rasterise to mask
Copy flattened
Ditch the mask
New from clipboard

The attached macro takes away some of the pain after the resize step

CopyResizedSelectionPITA.afmacro

Microsoft Windows 11 Home, Intel i7-1360P 2.20 GHz, 32 GB RAM, 1TB SSD, Intel Iris Xe
Affinity Photo - 24/05/20, Affinity Publisher - 06/12/20, KTM Superduke - 27/09/10

Posted
On 8/29/2022 at 11:47 AM, NotMyFault said:

This is a consequence of the underlaying algorithms used to handle layers: it will always/continuously resample the document layers to the canvas. If you resize a layer, this almost always creates a blurry edge, as the edge pixels (visible canvas) will be resample from multiple document pixels. Only  integer multiple / fractions could deliver sharp edges - with additional constraints.

To keep sharp edges, better export with new size and import back again, or use document-resize. Then you have at least full control which resample method is used. If you simply resize a layer inside a document, it is always bilinear or nearest neighbor (depending von performance settings). 
 

The handling of layers and resampling is one of the most mis-understood features.

I can assure this isn't the case as my steps did mention using document resize. Also for good measure I did make the crop from the png exported attached rescale for good measure and the issue was still present. I think - S - was spot on about the marquee tool being the source of the blurred edge, especially since the cropped paste is ~10 pixels wider than the crop dimensions itself not just a pixel off.

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.