1

I’ve about 300 images that I would need to resize all on the same size. Also, it would be nice to also nice to rename the resized images, so the original image is called file1.png, then the resized image as file1_thumb.png.

Could you recommend me, please, a tool for this task?

4 Answers 4

4

Mac OS X ships with a utility called sips (Scriptable Image Processing System) that can also suit your needs. Say you wanted to resize your 300 images to one-half the size and renamed to filename_small.jpg

cd ~/Pictures/batchConvert
for x in ./*; do
   WIDTH=$(sips -g pixelWidth "$x"|grep pixelWidth|awk '{print $2/2}')
   sips --resampleWidth $WIDTH "$x" --out $(echo $x|sed s/.jpg/_small.jpg/)
done

In addition, sips can read/write picture properties, change the output format, flip horizontal/vertical and more. Check out the man page for sips for more ideas.

2

You could use the great command line image processing tool, ImageMagick and a bash script like this to resize and rename your files:

find '/full/path/to/your/pics' -type f -name '*.png' |\
  while read FILENAME
  do
    NEW_FILENAME="$(echo $FILENAME | sed 's/.png//g')"
    convert -density 72 -resize "200x200>" -quality 90% "${FILENAME}" "${NEW_FILENAME}"_thumb.png
  done

Of course, you would need to change /full/path/to/your/pics to match your actual image path. Then you can change the convert (ImageMagick tool) options like -density, -resize and -quality to best suit your needs.

You could also change the _thumb.png to match whatever new filename you wish to use. If you set that to .png it would simply overwrite your files in place with the newly converted files. Or if you change the extension to .jpg or .gif you would be telling ImageMagick to convert the .png file to a .jpg or .gif. The configuration options of ImageMagick are a world unto themselves so it might seem a bit daunting at first, but spend some time learning the ropes and it is a rewarding and powerful tool.

But if ImageMagick is too complex for you, then “Graphic Converter” might be a better bet. It]s been around since the 1990s and is a great GUI tool for bulk image conversion and manipulation.

1

You can do this with Automator.

Create Thumbnail Images can resize and add a name suffix, however the resizing options are fixed at 128, 96, and 72 pixels.

If you'd like a different size you could use Scale Images and Rename Finder Items set to Add Text after the name. Note that these actions affect the files directly, so you would want to create a copy of the original images first, which could be part of the automator workflow (and, in fact, will be suggested when you add those actions to your workflow--you only need to copy the files once at the start of the workflow, though Automator may ask you twice).

1
  • I'd add screenshots of example workflows, but I don't have the reputation for that yet. ):
    – D.G.
    Feb 2, 2015 at 22:37
-1

You can also do that (and a lot more) with an application, in case you are not comfortable with Automator or scripting via a program called Photo Batch.

It has lots of features (quoting from the website):

  • Adjust image brightness, contrast and saturation.
  • Crop your image by percentage or by pixels.
  • Resize your image by percentage or by pixels.
  • Rotate all images at once.
  • Maintain image aspect ratio by setting the maximum pixel height or width.
  • Export all images to the same folder, regardless of where they came from.
  • Instantly rename all of your images.
  • Convert images from all major file formats (jpeg, png or tiff).
  • Preserve original metadata. Retina-ready graphics.

Not the answer you're looking for? Browse other questions tagged .