How to trim many files using adobe photoshop

I have 300 png files. I want to trim each of them. But for this I need open each file and make changes (even if I make script for trimming and save it will be long to open each file and do trimming). Is there already made solution or some advice how to do it better and quickly.

Thanks in advance.


Solution 1:

Another option using ImageMagick:

mogrify -trim *.png

You can install it with brew install imagemagick after installing Homebrew.

Solution 2:

Photoshop is a terrific software and ultimately is designed to save the end user time. So, since you are the owner of (or have access to) a license of PS, you have the right tool at your fingertips. I am going to assume you have the full version of Photoshop, not Elements. If you do have PS Elements, things may work differently, or not at all for you.

Preface: this should take you less then 10 minutes to take care of all 300 images, if it is just a matter of trimming them all. It may take you longer, however, since this is likely a first for you.

  1. Make sure all the images are in one folder.
  2. Open one of the images.
  3. Turn on the Actions Palette. (Window -> Actions).
  4. Create a new folder under Actions palette.
  5. Create a new action under your folder.
  6. It automatically starts recording.
  7. Trim the photo, and perform any procedures you normally do on the photo.
    • If you do any layer work, or other work that is more or less custom to each image during this process, things can get a little more tricky. Use keyboard shortcuts such as alt + [ and alt + ] to move between layers and make sure the right layer is selected. During this time, think automation. Try to think that every thing you do is being performed on 300 photos. PS doesn't record mouse clicks, it records actions, so simply clicking a layer may not have good results. You may want to create a folder in Finder which you can experiment with so you don't ruin any photos.
    • If it is as simple as running the Trim command, you are on easy terrain.
  8. After that photo is set, go ahead and save it like you would. This part doesn't matter a whole lot, but is a good step none-the-less.
  9. Now the fun part -- go to File -> Automate -> Batch, and choose the Actions folder that you created a moment ago.
    1. Select your source and destination folders (should be different).
    2. Override "Open" commands, and "Save As" actions.
  10. Click ok, and have some coffee.

It really is a very easy process, especially after you get the hang of it. There is a lot of information on Google about automating things in Photoshop, also.