Batch conversion of images using ImageMagic

Today I needed to convert multiple .pdf files into .tiff images with specific DPI and LZW compression. I found it’s very simple using ImageMagic.
[bash]
# install
sudo apt-get install imagemagick

# convert .pdf to lzw compressed .tiff changing dpi to 300
mkdir tiffs
for f in *.pdf; do
echo `date` $f;
convert -density 300 -compress lzw $f tiffs/$f.tiff;
done
date
[/bash]

For more options, have a look at ImageMagic site.

Advertisements

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