Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

4 Answers 4

up vote 25 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 at 2:20
    
works great Matt. Thank you! –  Coldstar Oct 28 at 19:19

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 at 15:43

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

 
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.