Practical tips help you use Apple stuff   Subscribe through Feedburner

Subscribe by Email · Subscribe to the MacTips feed · Follow MacTips on Twitter. · Follow us on YouTube. · Join MacTips on Facebook.

Looking for something in particular? A simple search is your best bet:

Or try the Categories and Tags page.

Resize images with Automator

Save hours of tedious work by using Automator to resize images for you. Here’s how.

Resize images with Automator
Mac Tip #280/14-March-2007

A friend recently complained of tedious amounts of time spent resizing photos and screenshots, which led me to explain how Automator can help. I mentioned Automator back in Automate It, Tip #195/11-May-2005.

I have a Finder folder of photos from my digital camera. In my case, each image is 2 or 3 megabytes, and maybe 3,888*2,952 pixels.

If I want to add some of these to my blog they need to be resized to more like 640*480 pixels and a much smaller file size.

Set up the action

Images selected in the Finder

Images selected in the Finder

Because I only ever work on copies of photos, and never the originals, I first copy the ones I want to resize to another folder and select them.

Click any image in this post to see a larger version.

Set up the Automator workflow

Drag an Automator action to a workflow

Drag an Automator action to a workflow

To resize selected photos open Automator (in the Applications folder). In the Library column on the left select Finder. From the Action column in the middle select ‘Get Selected Finder Items’ and drag the action into the large, empty Workflow area on the right.

Next select Preview in the Library column, and drag ‘Scale Images’ from the Actions column to the Workflow area. Make sure it goes below the ‘Get selected Finder Items’ action: actions occur in the order they appear in the workflow.

A warning lets you choose to copy the images first

A warning lets you choose to copy the images first

When you use ‘Scale Images’ an alert will appear asking if you wish to make a copy of the selected items before you change the image files.

I had already made a copy of my files so I chose ‘Don’t Add’, but ‘Add’ is always a safe choice.

After the ‘Scale Images’ action is added to the Workflow, enter the size in pixels of the desired longer side for your resized photos.

View results is a good check

The results are shown in the Results action

The results are shown in the Results action

The next step is optional, but useful. Select Automator in the Library column, and drag ‘View Results’ from the Actions column to be the last step in the Workflow.

Run the workflow

Finally, click the Run button. Automator resizes all the selected photos and reports the results in the ‘View Results’ area.

The resulting photos

My resized photos have a smaller file size

My resized photos have a smaller file size

The photos have been resized and each is now about 100Kb. This is a larger filesize than a dedicated (and expensive) program such as Photoshop would create, but this is a quick and free action.

Many actions are available

There are many other actions you can use, including changing filenames to lowercase, and opening the images in Preview. Explore Automator’s Actions list to find other actions you may wish to add to your workflow.

Save a workflow

Save the workflow with an expressive name

Save the workflow with an expressive name

If you think you may want to use this workflow again, choose Save from Automator’s File menu and save it to your computer. Tip: make the filename expressive: I called my workflow ‘resize-to-640′. Next time you want to resize a batch of photos in that same way double-click the workflow, select photos in the Finder and click Run in the Automator window.

(Updated April 2009) Download my Resize images workflow here. It’s a 60Kb zipped file, and includes an action to change the filename to lower case: MacTips.info resize images to 640 (200904) workflow (60Kb zipped file).

Update May 2009: I’ve moved the screenshots to a new location so the thumbnail sized images should be larger.

See more from: Automator,Finder,Mac Tips,iPhoto

It's great to see you visiting again! Have you tried the free MacTips updates via RSS or email, MacTips on Twitter and our YouTube channel? There may be more Tips on this topic. We'd love your Comments too.

Tell us what you think.
Note: there may be a delay before your comment appears. I now approve all comments from new visitors, in an attempt to keep spam at bay.

* 19 comments… read them below and tell us what you think.

Alvin 1 18 August 2007 at 00:43:36

I tried both your workflow and my own to resize pictures but I keep getting the same message:
Finder got an error: Can’t get file type of alias “Home:Desktop:Outdoor Photos:IMG_2334.JPG”. (-1728)

I have set the permissions for this folder to enable both read and write but still the same error message.

How did this error come about and how can i resolve it?

Reply

Miraz Jordan 2 27 August 2007 at 11:31:27

Well, 30 seconds of Googling found this:

http://www.macosxhints.com/article.php?story=20051020203919140

“when trying to rename Finder items) I get the following error:

AppleScript Error: Finder got an error: Can’t get properties of alias “user:path:to:file”. (error -1728)

It turns out that if you have FileVault enabled, many Automator actions break when you run them.”

I wonder if that’s your problem?

Reply

Esteban 3 1 July 2008 at 04:31:15

thanks, works perfectly.
i saved the workflow as a plugin for the finder
so i just gotta right klick the selected images und run the workflow, without starting automator

thanks

Reply

Suzanne 4 19 July 2008 at 09:32:54

Wow! Thank you very much for this explanation. This saves me a lot of time! I sure will start trying to find out what else Automator can do.

@Esteban, how do you make it a plugin for the finder?

Reply

Esteban 5 19 July 2008 at 14:21:56

hi suzanne,
check out the following screenshots:
http://mt11.quickshareit.com/gallery/view/99e318b0

now you can right-click a folder or images and choose “automator” and your workflow to resize them.
works perfectly

Reply

Miraz Jordan 6 30 July 2008 at 19:43:31

Esteban: many thanks for your handy suggestions. It’s cool that the Automator idea can be even more useful.

Cheers,

Miraz

Reply

Lily 7 19 February 2009 at 05:04:07

Maybe you can help: Today I used the Automator to change pdfs into jpgs. The first time I tried I couldn’t find the files anywhere but the “recent items” of the apple menu so I did it again and had it open in preview. I still cannot find the files anywhere and have now done it three times. I know they exist because I can see them in the recent items and even open them in open recent in Preview. I’ve searched in spotlight for the files by the names shown in preview, by date and manually. I am completely caught up in the mystery of where these files might be and it is driving me crazy. Any suggestions?

Reply

Miraz Jordan 8 2 March 2009 at 14:47:57

Lily, is it possible the files are in the Trash?

See this TidBITS article, Finder Inconsistency Could Lead to Data Loss:

http://db.tidbits.com/article/10062

Reply

Felipe 9 29 April 2009 at 01:41:19

Hello

I just switched to mac and I could really use this application. The problem is I cannot get the Finder to show the size of all the pictures at the same time, I have to check it picture by picture. Could you help me…

Felipe

Reply

Miraz Jordan 10 29 April 2009 at 11:59:56

Hi Felipe,

I found the challenge in your comment quite intriguing, and it led me to an interesting answer.

I’ve written up a blog post here: How to find the dimensions of multiple images on a Mac

http://knowit.co.nz/2009/04/how-to-find-the-dimensions-of-multiple-images-on-a-mac

Cheers,

Miraz

Reply

bakahaido 11 30 May 2009 at 23:46:26

thanks so much for your help. if not, i would not have known about this awesome software!

Reply

Steve 12 23 September 2009 at 20:40:45

That seems cool. well, for Mac users, i would like to introduce an image resizing tool, which is simple but powerful. It can satisfy all your resizing needs for making wallpaper, for web,etc. If you are a Mac user, that is worth a try.

Reply

wsblackcat 13 10 October 2009 at 19:17:34

thanks steve for your image resizing tool,it is so simple but powerful,that is really worth to try for the Mac user!

Reply

ezit 14 24 October 2009 at 01:51:50

Hi, nice article, though it didn’t answer the questions I had when I went googling:
What does resizing my picture to 640 mean? Does it mean it scales the whole picture until width equals 640, or height equals 640, or what?
How do I resize something to a more specific size, such as 390 by 749?

Reply

Miraz Jordan 15 27 October 2009 at 06:59:12

Ezit: the answer is in this part of the Tip: “After the ‘Scale Images’ action is added to the Workflow, enter the size in pixels of the desired longer side for your resized photos.”

You enter the size in pixels you want for the longest side. The action will size the longest side of your image to be that many pixels. The shorter side will be proportionately scaled.

I don’t think Automator can scale disproportionately. If you want to change the relative proportions I guess you’ll need to use real graphics software.

You could try opening the image in Apple Preview and use its image editing, scaling and cropping tools.

Reply

Linda Puyear 16 11 February 2010 at 15:18:57

HELP!!! I open Automator; have a folder of tif images pre-sellected selected in folder on desktop; drop the folder onto new Workflow; choose change to jpg as the only action; it happily changes them to jpg but also ruins all of them turning them into green tined, ultra color saturated junk. WHAT IS GOING ON?

Reply

Miraz 17 27 February 2010 at 20:00:35

Linda, I can’t see why that would happen, unless you were also using a ColorSync Profile action. Even so, perhaps it’s some problem with the color profile?

I suggest you try the Apple Support forums for more help.

Reply

Bobby 18 17 June 2010 at 22:11:55

Good day,

I’m trying to get Automator (OSX SL) to batch resize my photos which are all in specific folders and sub folders.

eg: Toyota > Toyota Corolla

The workflow I constructed is:

1. Get Specified Finder Items
2. Get Folder Contents
3. Scale Images

In this way, I was hoping I can batch scale my 21,000 photos. However, automator kept popping up a message that says:

Image events got an error. Can’t get image “filenameofimage.jpg”. (-1728)

And automator will stop after that. It happens randomly, even if I tried doing only one folder at a time.

However, most of the time if I do it one folder at a time, the second round will then proceed without any problems at all.

This is driving me nuts knowing I have to manually do folder by folder whenever this random problem comes up.

Help is very much appreciated.

Reply

Bobby 19 17 June 2010 at 22:21:00

I’m trying to get Automator (OSX SL) to batch resize my photos which are all in specific folders and sub folders.

eg: Honda> Honda Civic

The workflow I constructed is:

1. Get Specified Finder Items
2. Get Folder Contents
3. Scale Images

In this way, I was hoping I can batch scale my 21,000 photos. However, automator kept popping up a message that says:

(Image events got an error. Can’t get image “filenameofimage.jpg”. (-1728) )

And automator will stop after that. It happens randomly, even if I tried doing only one folder at a time.

However, most of the time if I do it one folder at a time, the second round will then proceed without any problems at all.

This is driving me nuts knowing I have to manually do folder by folder whenever this random problem comes up.

Help is very much appreciated.

Reply

Add your Comment

* 1 trackback

click here