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

Unable to Trim an Image using Clip Canvas


Recommended Posts

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?

 

tr-mikroe-gyro-8-click-3.png

Link to comment
Share on other sites

Go to the Document Menu and enable Transparent Canvas before using Clipping.

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

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.

-- 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

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.

-- 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

Clipping this image works OK for me.

 

ice_screenshot_20240913-130453.png.88460f383a7ea57eb67b598dbfb351f3.png

ice_screenshot_20240913-130522.thumb.png.44ef899a27c6c1d1296962c295db1bc1.png

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

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.

Link to comment
Share on other sites

1 hour ago, PaulEC said:

Clipping this image works OK for me.

 

ice_screenshot_20240913-130453.png.88460f383a7ea57eb67b598dbfb351f3.png

ice_screenshot_20240913-130522.thumb.png.44ef899a27c6c1d1296962c295db1bc1.png

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

-- 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

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?

-- 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

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.)

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

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

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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:

 

 

-- 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

You're welcome.

-- 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

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.