Jump to content
howdytom

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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?  

Share this post


Link to post
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.


Affinity Photo 1.7.1, Affinity Designer 1.7.1, Affinity Publisher 1.7.1; macOS High Sierra 10.13.6 iMac (27-inch, Late 2012); 2.9GHz i5 CPU; NVIDIA GeForce GTX 660M; 8GB RAM
Affinity Photo 1.7.1.143 & Affinity Designer 1.7.1.1 for iPad; 6th Generation iPad 32 GB; Apple Pencil; iOS 12.3.1

Share this post


Link to post
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)

Share this post


Link to post
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.


Affinity Photo 1.7.1, Affinity Designer 1.7.1, Affinity Publisher 1.7.1; macOS High Sierra 10.13.6 iMac (27-inch, Late 2012); 2.9GHz i5 CPU; NVIDIA GeForce GTX 660M; 8GB RAM
Affinity Photo 1.7.1.143 & Affinity Designer 1.7.1.1 for iPad; 6th Generation iPad 32 GB; Apple Pencil; iOS 12.3.1

Share this post


Link to post
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?


Affinity Photo 1.7.1, Affinity Designer 1.7.1, Affinity Publisher 1.7.1; macOS High Sierra 10.13.6 iMac (27-inch, Late 2012); 2.9GHz i5 CPU; NVIDIA GeForce GTX 660M; 8GB RAM
Affinity Photo 1.7.1.143 & Affinity Designer 1.7.1.1 for iPad; 6th Generation iPad 32 GB; Apple Pencil; iOS 12.3.1

Share this post


Link to post
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.

Share this post


Link to post
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.


Affinity Photo 1.7.1, Affinity Designer 1.7.1, Affinity Publisher 1.7.1; macOS High Sierra 10.13.6 iMac (27-inch, Late 2012); 2.9GHz i5 CPU; NVIDIA GeForce GTX 660M; 8GB RAM
Affinity Photo 1.7.1.143 & Affinity Designer 1.7.1.1 for iPad; 6th Generation iPad 32 GB; Apple Pencil; iOS 12.3.1

Share this post


Link to post
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!

Share this post


Link to post
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.


Affinity Photo 1.7.1, Affinity Designer 1.7.1, Affinity Publisher 1.7.1; macOS High Sierra 10.13.6 iMac (27-inch, Late 2012); 2.9GHz i5 CPU; NVIDIA GeForce GTX 660M; 8GB RAM
Affinity Photo 1.7.1.143 & Affinity Designer 1.7.1.1 for iPad; 6th Generation iPad 32 GB; Apple Pencil; iOS 12.3.1

Share this post


Link to post
Share on other sites

R C-R, Thank for your in-depth and excellent explanation. I really like the Affinity Community. Great and responsive support.

Share this post


Link to post
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.


Affinity Photo 1.7.1, Affinity Designer 1.7.1, Affinity Publisher 1.7.1; macOS High Sierra 10.13.6 iMac (27-inch, Late 2012); 2.9GHz i5 CPU; NVIDIA GeForce GTX 660M; 8GB RAM
Affinity Photo 1.7.1.143 & Affinity Designer 1.7.1.1 for iPad; 6th Generation iPad 32 GB; Apple Pencil; iOS 12.3.1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×