If you're working on an image and wind up with a canvas that's larger than the image pixels, here's a simple little script that will trim away the unused areas. It'll reduce the canvas to the smallest size that contains all the pixels of the actual images. In other words, it takes the value of the top left pixel of the canvas and uses that info to trim away pixels, so this script will work on a canvas having transparent pixels as well as coloured pixels.
Here are the steps to install the script:
/*
<javascriptresource>
<name>Trim</name>
<menu>automate</menu>
<about>Trim the canvas.</about>
<category>Image</category>
</javascriptresource>
*/
app.activeDocument.trim()
Enjoy!
Ken
Message was edited by: photodrawken to correct explanation.
You're welcome. It's already solved a user's problem. As I said in the other discussion, the very reasonably priced Elements+ add-in provides the additional options for trimming that the "big" Photoshop has:
Ken
P.S., No, I have absolutely no connection with Elements+ other than being a satisfied user.
photodrawken wrote:
Michel,
Yes, that also seems to work when backgrounds are filled with colour.
Ken
To be precise :
There might be a selection problem if part of the useful selection is the same color as the background (white part on white background for instance), but in most cases that will not change the trimming.
North America
Europe, Middle East and Africa
Asia Pacific