Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to mass convert a handful of .tif files. I found phatch could look like a good candidiate but I'm running Ubuntu 11.04. Looks like they don't have a .deb for my version.

Anyone have any alternatives to phatch or any other recommendations as to quickly batch convert tif to jpeg files.

I'm looking for a non-Photoshop (ala Wine) solution.

share|improve this question
up vote 33 down vote accepted

Easy. Install imagemagick $ sudo apt-get install imagemagick

It's simplest usage is: $ convert File.tif File.jpg

It is smart and goes by your file extension.

Now, for doing batch conversions, we shall use a loop.

cd into the directory where your tif files are.

then: $ for f in *.tif; do echo "Converting $f"; convert "$f" "$(basename "$f" .tif).jpg"; done

That should do it!

Also, once you convert all of the files and verify the new jpg's integrity, just run rm *.tif in that directory to delete all your old .tif files. Be careful with asterisks though, don't add a space after the *, or you will delete all your files in the directory.

Tip: If you have a folder with subfolders that holds these images. You could use this for loop to find all .TIF files within that folder: for f in $(find -name *.tif); do ...; done

share|improve this answer
Thanks! That help's a lot. – chrisjlee Sep 7 '11 at 15:26
Yep, you bet! =) – Matt Sep 7 '11 at 15:28
Is this supposed to print Converting filename.tif or Converting filename? – sodiumnitrate Oct 1 '14 at 2:20
works great Matt. Thank you! – Coldstar Oct 28 '14 at 19:19
@sodiumnitrate it will say "Converting filename.tif". the basename command takes 2 arguments, for example basename file.tif .tif will return "file" stripping the .tif extension away. You could modify the loop to say "Converting filename.tif to filename.jpg" with the same basename command, if you wished. – Matt Dec 7 '14 at 0:44

I found this question while trying to do it myself, for future reference you can also do it like this:

convert *.tiff -set filename: "%t" %[filename:].jpg

or to put it in a subdirectory

mkdir jpg
convert *.tiff -set filename: "%t" jpg/%[filename:].jpg
share|improve this answer
Yay for built-in filename handling. – beerbajay May 6 '14 at 15:43
This worked great for me with png files as well. The behavior for pdf's was different, however. – wdkrnls Mar 28 '15 at 5:04
I would love to see this working, however, this reported a Bus Error on ImageMagick 6.6.9-7 2014-03-06 Q16 (OpenMP) on Ubuntu 64. The accepted answer works fine. – TFuto May 1 '15 at 6:47
A word of warning: This froze for me the entire system (GNOME 3) and I had to hard shut down the computer – 0__ Jun 6 '15 at 11:54

Imagemagick should be able to convert them. It is a package of commandline programs, if you are OK with that.

Part of that is convert -

man convert:

convert - convert between image formats as well as resize an image, blur, crop, despeckle, dither, draw on, flip, join, re-sample, and much more.

share|improve this answer
Matt's answer is actually way more useful – marto Sep 7 '11 at 15:19
Yup. You're right there. – chrisjlee Sep 7 '11 at 15:26

If you prefer a GUI application, you can install Phatch through the normal repositories. Just open Ubuntu Software Center and search for it. I'm not on 11.04 anymore but I had it installed back then.

share|improve this answer

Your Answer


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.