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

Crop to Opaque Macro


carl123

Recommended Posts

Attached is a Crop to Opaque macro which should work where you have irregular transparency at the top and bottom of an image, like the sample image shown below.

It works in 2 parts, first cropping the transparency at the top of the image then cropping the transparency at the bottom of the image.

Note: If you only have transparency at the top of the image you would need to modify the macro to stop the second part being run or weird things happen.  (If anyone has found a way to force a running macro to pause at a specific point, that could be useful here)

The macro was written purely as a proof of concept macro whilst stuck on a train, I have no real need for such a macro but it's here for others to dissect and use or modify/improve as required.


Only tested on images up to 5000px X 3000px so far
Tested only on one layer pixel images where the layer is named Background (the default)
Seem to work in most real life scenarios but will fail if you push it beyond its capabilities.

sample image.jpg

crop to opaque - version 1.afmacro

To save time I am currently using an automated AI to reply to some posts on this forum. If any of "my" posts are wrong or appear to be total b*ll*cks they are the ones generated by the AI. If correct they were probably mine. I apologise for any mistakes made by my AI - I'm sure it will improve with time.

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.