Tell me more ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

The program should run in batch mode to resize all files in a folder and then save new files to different folder. An option for setting jpg quality would be great, too.

share|improve this question
2  
A combination of find and ImageMagic. – mspasov Feb 24 '12 at 12:05

11 Answers

up vote 28 down vote accepted

I'm a little surprised that no one has mentioned the easiest, cheapest, and least technical option:

Automator

First, open Automator, which is in your Applications folder.

Next, choose to create a new workflow:

Create an automator workflow

Next, add the following steps to the workflow by dragging and dropping:

workflow steps

When you run this, Automator is going to:

  1. pop up a window asking you to pick some files (as many as you want)
  2. pop up another window asking where you want to save the resized copies
  3. ask you how big you want the resized copies to be. You'll be able to choose either a fixed size or a percentage. All the images will be resized to either that size or by that percentage.

(The "show this action when the workflow runs" checkbox means that the workflow is going to pause, display the option, and allow you to change it then)

Once you do that, Automator is going to churn and burn, and when it's done it'll beep at you.

Unfortunately, it doesn't seem to have an option to choose JPEG quality. However, for the price (free), it's pretty dang convenient.

share|improve this answer
It maybe the least technical for someone who does not use Terminal. And possibly the easiest, But its not the cheapest out of the answers here. Sips is included in the Unix build of the Mac. And ImageMagick is also free. – markhunte Feb 24 '12 at 7:18
3  
It's safe to assume that Automator is, for the purposes of this discussion free because it is reasonable to assume that @mototribe is running OS X. My one concern would be how well Automator would handle 100,000 images but, assuming they're not all in a single folder, I'd just keep feeding it one folder at a time until it was done. I've run this very workflow against hundreds of images without difficulty. I see no reason why it wouldn't work against many thousands, as each image is pushed through one-at-a-time, but I'd be in trust but verify mode. – jaberg Mar 1 '12 at 18:51

You could also use sips, but like Automator, it would often require sharpening before or after downsampling images.

for f in *.jpg; do sips -Z 800 -s format jpeg -s formatOptions 80 "$f" -o ~/Desktop/; done

A better option might be to use ImageMagick, which can be installed with Homebrew or MacPorts.

mogrify -filter Lanczos2 -resize 500x -format jpg -quality 95 -path ~/Desktop/ *.jpg

Lanczos2 (2-pole Lanczos) is similar to Catrom and other cubic filters. Compared to Lanczos (Lanczos3), the output images are slightly less sharp; ringing artifacts are less common but Moiré patterns are more common.

If the filter is not specified, it currently defaults to Triangle (linear or bilinear) which would usually require additional sharpening when downsampling images.

The option for JPG quality has a fairly high slope. Depending on the size of the images and the amount of detail in them, 100 might result in files about twice as big 95, which might result in files about twice as big as 89.

I made a visual comparison of the different options: http://f.cl.ly/items/3W290e221m3w1b3x1A0H/downsampling%20test.png (WMD seems to convert large png images to jpg).

share|improve this answer
1  
I'd like to warn you to use mogrify: this converts the files in-place, overwriting the original ones! If anything goes wrong, you have lost your files! Better use convert (also from ImageMagick). – Kurt Pfeifle Jul 6 '12 at 19:14
1  
@KurtPfeifle It doesn't if you specify the -path option (which convert doesn't currently have). – Lauri Ranta Jul 17 '12 at 15:39

If You don't mind using the terminal ImageMagick might be a good solution (can be installed with MacPorts).

share|improve this answer
thanks, that's what I ended up using - however I installed it on Drupal since I'm importing the images into Drupal. – MotoTribe Feb 25 '12 at 3:24

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer: please explain why you're recommending it as a solution. Answers that don't explain anything will be deleted. See Good Subjective, Bad Subjective for more information.

Several people have mentioned ImageMagick. Here is a recipe: For simplicity, assume all the files are in one folder (and the folder contains nothing else). Open a terminal window, cd into this folder, then run

mkdir ../resized
for x in *.jpg; do convert -geometry 800x600 $x ../resized/$x

where you replace the 800x600 by whatever size you want.

Advantages include a great amount of flexibility in ImageMagick's convert, such as the ability to select different quality settings for the target image, or setting the resize option by percentages. Or you can use -geometry 800x800, in which case the aspect ratio will be preserved, but the maximum of the width and height will be 800 pixels.

Disadvantages are the obvious ones: It requires a certain familiarity with the command line, plus a willingness to plough through the command line options of convert for the settings you want. This is not a task for the faint of heart.

share|improve this answer

I second GraphicConverter. I've been a registered user for 16 years. Its main purpose is batch-processing image editing, and it has a good user interface for designing custom workflows and saving them.

You can also use it in conjunction with Automator, but you probably won't need to.

Here is some information from GraphicConverter's page explaining their batch processing image editing functions.

Batch conversion with additional functions

GraphicConverter offers you sophisticated batch processing which fully automates repetitive tasks applied to a selection of pictures:

  • Convert all the selected source pictures easily and quickly into a new format - regardless of whether there are 5 or 5,000 picture files; you just define the type of conversion and set the details
  • During the conversion process you can apply up to 60 additional batch functions such as rotation, resize, change the resolution, etc.
  • Automate the removal of the Mac OS Ressourcefork before documents are uploaded if there are compatibility problems when the picture files are placed in the internet
  • Create catalogs in HTML format for publication in the internet and adjust the colors, sizes, etc. to your individual requirements (see examples)
  • Rename a selection of documents according to special criteria quickly and easily
  • Join pictures together (e.g. for QuickTime VR)
  • Insert or extract IPTC information into or out of a variety of document formats
  • and much more ...

enter image description here

share|improve this answer

This is yet another simple, clean and effective batch image resize script. If you are dealing with graphics and different resolutions a lot, you can use this script and save it with different values for occasional uses.

Do so, by changing this target_width 120 value to your needs and save the script. Now drag your image(s) onto the saved script-file to start resizing your image(s).


Open Script Editor, and create the following new script:

-- save in Script Editor as Application
-- drag files to its icon in Finder

on open some_items
  repeat with this_item in some_items
    try
      rescale_and_save(this_item)
    end try
  end repeat
end open


to rescale_and_save(this_item)
  tell application "Image Events"
    launch
    set the target_width to 120
    -- open the image file
    set this_image to open this_item

    set typ to this_image's file type

    copy dimensions of this_image to {current_width, current_height}
    if current_width is greater than current_height then
      scale this_image to size target_width
    else
      -- figure out new height
      -- y2 = (y1 * x2) / x1
      set the new_height to (current_height * target_width) / current_width
      scale this_image to size new_height
    end if

    tell application "Finder" to set new_item to ¬
    (container of this_item as string) & "scaled." & (name of this_item)
    save this_image in new_item as typ

  end tell
end rescale_and_save

original source

share|improve this answer

Graphic Converter

The best for this..

share|improve this answer
5  
Can you explain why GC is the best option? – Nathan Greenstein Feb 24 '12 at 1:04
Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – daviesgeek Feb 24 '12 at 18:10

Preview is certainly a good solution for some occasional resizing. There are also other nice free options, such as ImageMagic (command-line utility), Preview or something else plus Automator, etc.

However, if this is a part of your job and you need a true flexibility, a special-purpose application will save you a lot of time, and offer much more opportunities. Many users chose our batch image resizer Resize Sense (http://veprit.com/resizesense) for its outstanding flexibility and convenience.

Disclaimer: I am the developer. You better judge Resize Sense yourself. The introductory video on the product website will tell you exactly what is so special in Resize Sense. There is a free demo version.

share|improve this answer

I usually import all of the pictures into iPhoto and then export them to the different sizes. I have done it on batches of 300 or so images, but never on the scale you are wanting. Still, it may be an option.

share|improve this answer

No one has mentioned Apple Aperture.

While by no means the cheapest, it comes with a lot of other things that you may find useful. It basically replaces iPhoto and then some. It does 95% of what photographers commonly use Photoshop for. (It won't do flaming text. :-)

But unless you need the other things Aperture gives you, I second both the ImageMagick approach -- if you're not intimidated by downloading, installing, and running command-line programs, and the Automator approach, which despite @markhunte's claim, is free.

share|improve this answer

I use wine (and XQuartz) and IrfanView. Of course you could also use imagemagick from the command-line. For wine and imagemagick I would recommend Homebrew.

irfanview in wine on OS X

share|improve this answer
I've used Irfanview for over 10 years on the PC and love it. But they don't have a Mac version? – MotoTribe Feb 24 '12 at 1:43
1  
I Suspect they mean they run IrFranView under wine. Wine lets you run Windows software on other operating systems. With Wine, you can install and run these applications just like you would in Windows. The screenshot clearly shows Mac type windows (buttons at top) with PC Window GUI – markhunte Feb 24 '12 at 7:21
4  
Using Wine with a Windows application is really an overkill for something that you can do natively. – Matteo Feb 24 '12 at 11:20

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.