johngwms Posted September 13 Share Posted September 13 I need to automate the removal of whitespace around an image before resizing. I recently moved from Photoshop to Affinity Photo 2 and used to do this with The Photoshop Trim command. I have attached a sample PNG image which I am having problems with I have tried using the Document | Clip Canvas and Tasterize and trim commands but neither do anything. I have unlocked the single image layer. Can anyone please suggest what I am doing wrong? Quote Link to comment Share on other sites More sharing options...
PaulEC Posted September 13 Share Posted September 13 Go to the Document Menu and enable Transparent Canvas before using Clipping. Quote Acer XC-895 : Core i5-10400 Hexa-core 2.90 GHz : 32GB RAM : Intel UHD Graphics 630 : Windows 10 Home Affinity Publisher 2 : Affinity Photo 2 : Affinity Designer 2 : (latest release versions) on desktop and iPad Link to comment Share on other sites More sharing options...
johngwms Posted September 13 Author Share Posted September 13 I have Transparent Background enabled. Quote Link to comment Share on other sites More sharing options...
walt.farrell Posted September 13 Share Posted September 13 30 minutes ago, johngwms said: I have Transparent Background enabled. In that case, you have white pixels in your PNG file, around your green object. Clip Canvas does not remove any pixels. It shrinks the Canvas to include only the non-transparent areas. And for you that would include your white pixels. Quote -- Walt Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases PC: Desktop: Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 Laptop: Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU. Laptop 2: Windows 11 Pro 24H2, 16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU iPad: iPad Pro M1, 12.9": iPadOS 17.7, Apple Pencil 2, Magic Keyboard Mac: 2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.7 Link to comment Share on other sites More sharing options...
walt.farrell Posted September 13 Share Posted September 13 I would use the Flood Select Tool, set to Contiguous mode. Click in the white area and it should select all those white pixels. Then press Delete, and you should have transparent areas around the object. Then try Clip Canvas. Quote -- Walt Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases PC: Desktop: Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 Laptop: Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU. Laptop 2: Windows 11 Pro 24H2, 16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU iPad: iPad Pro M1, 12.9": iPadOS 17.7, Apple Pencil 2, Magic Keyboard Mac: 2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.7 Link to comment Share on other sites More sharing options...
PaulEC Posted September 13 Share Posted September 13 Clipping this image works OK for me. Quote Acer XC-895 : Core i5-10400 Hexa-core 2.90 GHz : 32GB RAM : Intel UHD Graphics 630 : Windows 10 Home Affinity Publisher 2 : Affinity Photo 2 : Affinity Designer 2 : (latest release versions) on desktop and iPad Link to comment Share on other sites More sharing options...
johngwms Posted September 13 Author Share Posted September 13 2 hours ago, walt.farrell said: I would use the Flood Select Tool, set to Contiguous mode. Click in the white area and it should select all those white pixels. Then press Delete, and you should have transparent areas around the object. Then try Clip Canvas. Thank you Walt. As I need to process each image with a macro, it will not be practical to select areas. Quote Link to comment Share on other sites More sharing options...
johngwms Posted September 13 Author Share Posted September 13 1 hour ago, PaulEC said: Clipping this image works OK for me. Thanks for trying it Paul. That implies something is blocking the functionality in the way Affinity is set up. At least I now know that it should be possible. Quote Link to comment Share on other sites More sharing options...
johngwms Posted September 13 Author Share Posted September 13 2 hours ago, walt.farrell said: In that case, you have white pixels in your PNG file, around your green object. Clip Canvas does not remove any pixels. It shrinks the Canvas to include only the non-transparent areas. And for you that would include your white pixels. Maybe, but that is unlikely as I used remove.bg to remove the background of this image. I also have the same issue with a JPEG file with a white background. Quote Link to comment Share on other sites More sharing options...
walt.farrell Posted September 13 Share Posted September 13 18 minutes ago, johngwms said: I also have the same issue with a JPEG file with a white background. JPG files do not have transparency, so definitely if you see white around it they are pixels, which will not be removed by Clip Canvas. Quote -- Walt Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases PC: Desktop: Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 Laptop: Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU. Laptop 2: Windows 11 Pro 24H2, 16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU iPad: iPad Pro M1, 12.9": iPadOS 17.7, Apple Pencil 2, Magic Keyboard Mac: 2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.7 Link to comment Share on other sites More sharing options...
walt.farrell Posted September 13 Share Posted September 13 22 minutes ago, johngwms said: Thanks for trying it Paul. That implies something is blocking the functionality in the way Affinity is set up. At least I now know that it should be possible. Can you supply the image as a .zip file? Quote -- Walt Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases PC: Desktop: Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 Laptop: Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU. Laptop 2: Windows 11 Pro 24H2, 16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU iPad: iPad Pro M1, 12.9": iPadOS 17.7, Apple Pencil 2, Magic Keyboard Mac: 2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.7 Link to comment Share on other sites More sharing options...
PaulEC Posted September 13 Share Posted September 13 With a JPEG you could remove the white background with the Flood Select Tool, then clip the transparency. (Don't try to do it with the Erase White Paper filter, as that would also remove the white on the main image.) Quote Acer XC-895 : Core i5-10400 Hexa-core 2.90 GHz : 32GB RAM : Intel UHD Graphics 630 : Windows 10 Home Affinity Publisher 2 : Affinity Photo 2 : Affinity Designer 2 : (latest release versions) on desktop and iPad Link to comment Share on other sites More sharing options...
johngwms Posted September 13 Author Share Posted September 13 1 minute ago, walt.farrell said: Can you supply the image as a .zip file? Sure, here we go tr-mikroe-gyro-8-click-3.zip walt.farrell 1 Quote Link to comment Share on other sites More sharing options...
johngwms Posted September 13 Author Share Posted September 13 5 minutes ago, PaulEC said: With a JPEG you could remove the white background with the Flood Select Tool, then clip the transparency. (Don't try to do it with the Erase White Paper filter, as that would also remove the white on the main image.) Paul, dont I have to select the white area, first? I need to process the file with a macro Quote Link to comment Share on other sites More sharing options...
johngwms Posted September 13 Author Share Posted September 13 I didn't realize that the image must have a transparent background for the Clip Canvas command to work. I have now tried it with a PNG image on a transparent background and it works. I thought I had tried that before. Heyho. Photoshop will clip (trim) with a white background. Shame Affinity doesn't. I will now have to process all my images in the Remove.bg before running them though a macro in Affinity Photo to perform resizing etc. Thank you all for your help. John Quote Link to comment Share on other sites More sharing options...
walt.farrell Posted September 13 Share Posted September 13 29 minutes ago, johngwms said: Sure, here we go Thanks. As Paul said, for that document, Document > Clip Canvas works fine as long as you've used Document > Transparent Background: 20240913-1511-02.4002888.mp4 Quote -- Walt Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases PC: Desktop: Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 Laptop: Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU. Laptop 2: Windows 11 Pro 24H2, 16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU iPad: iPad Pro M1, 12.9": iPadOS 17.7, Apple Pencil 2, Magic Keyboard Mac: 2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.7 Link to comment Share on other sites More sharing options...
walt.farrell Posted September 13 Share Posted September 13 You're welcome. Quote -- Walt Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases PC: Desktop: Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 Laptop: Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU. Laptop 2: Windows 11 Pro 24H2, 16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU iPad: iPad Pro M1, 12.9": iPadOS 17.7, Apple Pencil 2, Magic Keyboard Mac: 2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.7 Link to comment Share on other sites More sharing options...
Recommended Posts
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.