Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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.

share|improve this question
    
300 .pngs? Why not let that run overnight? IMO Photoshop will clearly be your best option. Are you asking how to create a batch and automate the process you described? –  bassplayer7 Apr 1 '13 at 23:20
    
I already have 300 images with transparent background inside. So I want to get rid of the transparent pixel around image inside png. So in Phothoshop I have ability to do it using Image->Trimming option. But for many files it is too boring and this process takes a lot of my time. Maybe is there any automation even without using photoshop. thanks. –  Matrosov Alexander Apr 1 '13 at 23:53

2 Answers 2

Another option using ImageMagick:

mogrify -trim *.png

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

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.