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

Affinity Photo: How can I trim a image to its size?


Recommended Posts

Hi there,

 

in Photoshop I am using the trim feature for white and transparent backgrounds a lot. To be specific, here's the Photoshop Workflow: Youtube Video example

 
I’ve tried to the same workflow it Affinity Photo without luck.
 
Here's what I tried: I am able to to select the image using
  • the Magic Wand - Selection
  • Inverse the selection and
  • copy the image to a new document. However in Photoshop times usually it automatically creates the exact document size. I don't know the exact dimension.
 
I hope this makes sense. Looking forward to a quick reply.
Link to comment
Share on other sites

  • Staff

Hi howdytom,

Welcome to Affinity Forums :)

Clip to canvas will reveal all objects even if they cross the canvas boundaries. This function is usually used to remove unused areas from the canvas, assuming most of the elements are contained within the canvas area. If that's not the case Affinity will extend it up to the boundaries of the elements that cross its margins so all fit inside the it. Since Affinity Crop Tool in non-destructive (we keep all the cropped data hidden) it ends up revealing the cropped parts as well.

 

Currently there's no Trim to transparent or to a specific colour function in Photo.

Link to comment
Share on other sites

MEB, thank you for your reply. 

 

 

 

Currently there's no Trim to transparent or to a specific colour function in Photo.

 

This is exactly I am looking for. It's a must have-feature. I am using it all-day in PS. How can I add a feature request?  

Link to comment
Share on other sites

howdytom,

 

I am not sure this is what you are looking for but you might try this modified version of your Affinity Photo workflow:

 

1. If the background is not transparent, first use the Magic Wand tool to select & delete it.

2. CMD-click (Mac, probably Control-click on Windows) on the image layer's thumbnail in the Layers panel. This should select all non-transparent pixels.

3. Copy the selection to the clipboard.

4. From the File menu use "New From Clipboard" to create a new file, which should be no larger than is needed to contain the selected pixels.

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

This is exactly what I was looking for. In PS you don’t need the extra step using the Magic Wand tool. it simply auto trims transparent or solid color backgrounds.

 

Wow awesome workaround, R C-R! 

 
Thank you so much!  B)
Link to comment
Share on other sites

Howdy again, howdytom.  :)

 

I am glad that works for you but I am curious about how PS determines what to trim when the background is not transparent (unlike in the YouTube example). Are you sure when it does that the background is not a separate layer rather than part of the image itself?

 

Also, I should probably mention that for single layer images in Affinity with color noise in the background, it can be tricky to select all of the background color with the Magic Wand tool at a high enough tolerance setting to get all of it without also selecting a part of the foreground image you want to keep. Sometimes I find it necessary to use a lower tolerance setting & then the Erase tool to go around the outer edges of the image layer to make sure all the background pixels are erased before copying the layer.

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

Here how it works in PS:

What happens if the background includes color noise, so neither of the two corner pixels is exactly the same as nearby ones? Is there some kind of built-in automatic tolerance function that dynamically adjusts for that?

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

@R C-R

No, there’s no tolerance function in PS. It’s pretty reliable though and PS automatically trims it correctly. 
 
Indeed, color noise is an issue in low quality resolution images. PS trims to the nearby pixel on top, bottom, left and right, than it stops. In this case I am manually cropping the image file.
Link to comment
Share on other sites

 In this case I am manually cropping the image file.

If you are manually cropping the image, after using Affinity's non-destructive Crop tool you can select the image layer in the Layers panel & choose Rasterize from the popup contextual menu choices. This will destructively remove everything outside the cropped dimensions of the image.

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

 

 

This will destructively remove everything outside the cropped dimensions of the image.

 

okay, thank you. Question: Since Rasterize removes everything outside the cropped area, file size should also decrease, isn't it?

 

This is an excellent advice. My Affinity workflow is getting better and better. ;.-) excellent!

Link to comment
Share on other sites

Because of how the native Affinity file format works, there may or may not be any reduction in file size -- in fact, the file size may increase slightly or substantially.

 

As I understand it (which is imperfectly & incompletely!) this is primarily due to serialization. As best as I can explain it, edits are stored as deltas (differences from the original) at the end of the file until an automatic process not under user control consolidates everything into one image, removing all the redundant data. Supposedly, using Save As instead of Save forces this consolidation to occur, thus reducing the file to its smallest size, but for me this usually does not work.

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

Please don't take my explanation for the file size changes as anything other than my own imperfect interpretation of what the staff have mentioned in other topics. Some or all of it may be well off the mark.

 

That said, I agree that this is a great & very responsive forum. Both the staff & many users devote considerable time to answering questions, sharing their expertise, & learning from each other. I consider it one of the best "features" of the software.

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

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.