batch image convert, scale, thumbnail, JPEG(s) –> PDF

update: this article has been superseded by batch image convert, scale, thumbnail, JPEG(s), retain high resolution using antialias.

ImageMagick (Linux/Windows) includes mogrify which allows us to scale and convert image files in batch mode from the command line. It provides a huge number of options but you only need a few examples to start making use of it…

Creates thumbnail images using all the jpg files in the current directory:

mogrify -compress JPEG -quality 80 +profile *.jpg

Re-size all the jpg files in the current directory:

mogrify -sample 800x1200 *.jpg

Create a PDF document using all the jpg files in the current directory:

convert *jpg allinone.pdf

Convert all tif images to jpgs:

mogrify -format jpg -quality 50 *.tif

Scale all jpgs in the current directory by 50%:

mogrify -scale 50% *.jpg

If you need further examples, just search Google!

About these ads

7 Responses to “batch image convert, scale, thumbnail, JPEG(s) –> PDF”


  1. 1 BenjieP August 10, 2007 at 3:46 pm

    Thanks for posting that! I’ve been looking around for a batch scaler from the command line, and I think I just found it. Scaled a good 100 pictures in a couple minutes… not bad!

    BenjieP

  2. 2 Morten December 6, 2007 at 9:53 am

    You just made my day alot easier! Converted a 3 MB pdf to jpeg and then back to pdf within the 2 MB upload limit i needed it to be, with this very nice function:)

  3. 3 NMC April 27, 2008 at 7:39 am

    Thanks for this. I kept on trying to use the convert command to convert all my .jpg’s to .png format. It was driving me mad. The mogrify command worked, though.

  4. 4 nabstersblog October 31, 2008 at 6:12 pm

    I previously used a free script from the following page

    http://koan.studentenweb.org/software/jpeg2pdf.html


  1. 1 alviano.net » Creare un PDF da una lista di immagini (JPEG, PNG, …) Trackback on September 25, 2008 at 3:28 pm
  2. 2 batch image convert, scale, thumbnail, JPEG(s), retain high resolution using antialias « ramblings of a linux user Trackback on November 22, 2008 at 12:30 am
  3. 3 Creare un PDF da una lista di immagini (JPEG, PNG, …) | alviano.com/.net/.org Trackback on April 8, 2012 at 9:18 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s





Follow

Get every new post delivered to your Inbox.

%d bloggers like this: