Personal computing discussed

Moderators: renee, Dposcorp, SpotTheCat

 
flip-mode
Grand Admiral Gerbil
Topic Author
Posts: 10218
Joined: Thu May 08, 2003 12:42 pm

Batch image convertion (tif to jpg or png)

Fri Apr 17, 2009 9:26 am

I'm looking to covert potentially thousands of tifs to either png or jpg. Anyone know the best tool for the job? I have Photoshop, but don't know if it will do it. I have a Linux machine. I'm not allowed to spend any money to make this happen.
 
mattsteg
Gerbil God
Posts: 15782
Joined: Thu Dec 27, 2001 7:00 pm
Location: Applauding the new/old variable width forums
Contact:

Re: Batch image convertion (tif to jpg or png)

Fri Apr 17, 2009 9:32 am

Photoshop's fine. File/automate/batch or file/scripts/image processor should do what you need. There's also stuff in bridge from what I recall. Imagemagick would work as well, if you wanted to use linux(or windows)+CLI.
...
 
flip-mode
Grand Admiral Gerbil
Topic Author
Posts: 10218
Joined: Thu May 08, 2003 12:42 pm

Re: Batch image convertion (tif to jpg or png)

Fri Apr 17, 2009 9:35 am

Thanks Matt. I'll try using Photoshop first since I already have that installed.
 
just brew it!
Administrator
Posts: 54500
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Batch image convertion (tif to jpg or png)

Fri Apr 17, 2009 9:37 am

A Python script on the Linux box (or install Windows version of Python and Python Imaging Library on the Windows box) would also work.

I can probably provide further details on how to do this with Python/PIL this weekend if you'd like further assistance...
Nostalgia isn't what it used to be.
 
sliknik
Gerbil
Posts: 54
Joined: Sun Apr 07, 2002 2:52 pm
Location: Guyana, South America.
Contact:

Re: Batch image convertion (tif to jpg or png)

Fri Apr 17, 2009 9:38 am

I know you specified linux, so this is not likely to be particularly helpful, but you mentioned photoshop which probably means that you have access to windows (or Mac). If you do I highly recommend Faststone Photo Resizer. I have been using it for a couple years now, it is freeware, handles multiple formats and in batches and can do a number of tasks in addition to conversion between formats; including resizing, adding watermarks, and many more. And it is very fast. Did I mention free?

http://www.faststone.org/FSResizerDetail.htm
 
flip-mode
Grand Admiral Gerbil
Topic Author
Posts: 10218
Joined: Thu May 08, 2003 12:42 pm

Re: Batch image convertion (tif to jpg or png)

Fri Apr 17, 2009 9:41 am

sliknik wrote:
I highly recommend Faststone Photo Resizer.
Funny you should mention that - I was just looking at it on Cnet Downloads - pretty highly regarded there it seems.
 
just brew it!
Administrator
Posts: 54500
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Batch image convertion (tif to jpg or png)

Fri Apr 17, 2009 9:41 am

flip-mode wrote:
Thanks Matt. I'll try using Photoshop first since I already have that installed.

In the past, I've done stuff like this using a fairly ancient version of Corel PhotoPaint so I'd assume Photoshop can do it too. In PhotoPaint you did it by creating a macro, and telling it to iterate the macro over all the files to be converted.
Nostalgia isn't what it used to be.
 
flip-mode
Grand Admiral Gerbil
Topic Author
Posts: 10218
Joined: Thu May 08, 2003 12:42 pm

Re: Batch image convertion (tif to jpg or png)

Fri Apr 17, 2009 9:44 am

just brew it! wrote:
flip-mode wrote:
Thanks Matt. I'll try using Photoshop first since I already have that installed.

In the past, I've done stuff like this using a fairly ancient version of Corel PhotoPaint so I'd assume Photoshop can do it too. In PhotoPaint you did it by creating a macro, and telling it to iterate the macro over all the files to be converted.
Photoshops batch interface looks confusing, probably because it is capable of so much more than simple file type conversion. In this case, simpler is better, so I want to look at the FastStone thing real quick.
 
mattsteg
Gerbil God
Posts: 15782
Joined: Thu Dec 27, 2001 7:00 pm
Location: Applauding the new/old variable width forums
Contact:

Re: Batch image convertion (tif to jpg or png)

Fri Apr 17, 2009 9:46 am

flip-mode wrote:
just brew it! wrote:
flip-mode wrote:
Thanks Matt. I'll try using Photoshop first since I already have that installed.

In the past, I've done stuff like this using a fairly ancient version of Corel PhotoPaint so I'd assume Photoshop can do it too. In PhotoPaint you did it by creating a macro, and telling it to iterate the macro over all the files to be converted.
Photoshops batch interface looks confusing, probably because it is capable of so much more than simple file type conversion. In this case, simpler is better, so I want to look at the FastStone thing real quick.

The "image processor" script in photoshop is simpler.
...
 
just brew it!
Administrator
Posts: 54500
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Batch image convertion (tif to jpg or png)

Fri Apr 17, 2009 9:57 am

Upon further reflection, I'm changing my vote. Just use ImageMagick's convert tool: http://www.imagemagick.org/script/convert.php and a simple bash script (on the Linux box, or on Windows + cygwin).
Nostalgia isn't what it used to be.
 
drfish
Gerbil Elder
Posts: 5546
Joined: Wed Jan 22, 2003 7:53 pm
Location: Zeeland, MI

Re: Batch image convertion (tif to jpg or png)

Fri Apr 17, 2009 10:22 am

I've been using Ifran for this kind of thing for a long time (after giving up on Bimp ever becoming stable). Apparently it runs well in Wine. :-?
 
flip-mode
Grand Admiral Gerbil
Topic Author
Posts: 10218
Joined: Thu May 08, 2003 12:42 pm

Re: Batch image convertion (tif to jpg or png)

Fri Apr 17, 2009 10:26 am

Thanks all. The FastStone thing is very nice because in the default view it shows all the images in the folder and allows you to sort by type, select a range, and the right click > batch. Very very simple. But, JBI, I still want to look into the ImageMagic solution because, being a bash tool, I wager that it has the ability to very easily do this recursively. That would be win.
 
just brew it!
Administrator
Posts: 54500
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Batch image convertion (tif to jpg or png)

Fri Apr 17, 2009 10:30 am

flip-mode wrote:
Thanks all. The FastStone thing is very nice because in the default view it shows all the images in the folder and allows you to sort by type, select a range, and the right click > batch. Very very simple. But, JBI, I still want to look into the ImageMagic solution because, being a bash tool, I wager that it has the ability to very easily do this recursively. That would be win.

ImageMagick should be available in the repository for your Linux distro (if it isn't installed on your Linux box already; if you've installed anything else that uses it internally, it may have already been pulled in as a dependency).

Just type "convert" at a command prompt and see if anything comes up... if you get a list of command line options, then ImageMagick is already there. :wink:
Nostalgia isn't what it used to be.
 
Hance
Darth Gerbil
Posts: 7775
Joined: Mon Sep 29, 2003 1:58 pm
Location: Grace Idaho
Contact:

Re: Batch image convertion (tif to jpg or png)

Fri Apr 17, 2009 10:33 am

I use Magic Image Resizer for projects like this. I don't know if it supports tiff files but its very simple to use and you can pick the number of pixels you want the new photo to be.
 
flip-mode
Grand Admiral Gerbil
Topic Author
Posts: 10218
Joined: Thu May 08, 2003 12:42 pm

Re: Batch image convertion (tif to jpg or png)

Fri Apr 17, 2009 10:48 am

just brew it! wrote:
Just type "convert" at a command prompt and see if anything comes up... if you get a list of command line options, then ImageMagick is already there. :wink:
Linux ubuntu-wkst0 2.6.27-11-generic #1 SMP Wed Apr 1 20:53:41 UTC 2009 x86_64


flip-mode@ubuntu-wkst0:~$ convert
The program 'convert' can be found in the following packages:
* imagemagick
* graphicsmagick-imagemagick-compat
Try: sudo apt-get install <selected package>
-bash: convert: command not found
flip-mode@ubuntu-wkst0:~$
 
flip-mode
Grand Admiral Gerbil
Topic Author
Posts: 10218
Joined: Thu May 08, 2003 12:42 pm

Re: Batch image convertion (tif to jpg or png)

Fri Apr 17, 2009 10:50 am

And now it's installed. Heh. I love Ubuntu.
 
Momento Mori
Gerbil First Class
Posts: 194
Joined: Tue Sep 09, 2008 5:25 pm
Location: Northeast Ohio

Re: Batch image convertion (tif to jpg or png)

Fri Apr 17, 2009 12:32 pm

In Photoshop all you need to do is go to the actions tab, which is normally under the history tab on your right hand side of the interface assuming default tool placements use the icon that says create action. Hit the record button sort of like making a Macro in other apps, open one of the files in question in fact you can actually already have it open before you hit record in any case, the record needs to be on when you do the save as to your target directory. After it has recorded you doing the 'save as action' with the settings you wanted hit the stop recording button. Save the Action, you should now be able to use it from the batch menu under File > Automate > Batch, select your new action, select the source directory and the target directory, let photoshop do the rest. I can give a more detailed description if you get stuck anywhere; these instructions assume Adobe Photoshop 8.0 (CS1).
Image
 
mattsteg
Gerbil God
Posts: 15782
Joined: Thu Dec 27, 2001 7:00 pm
Location: Applauding the new/old variable width forums
Contact:

Re: Batch image convertion (tif to jpg or png)

Fri Apr 17, 2009 12:38 pm

Momento Mori wrote:
In Photoshop all you need to do is go to the actions tab, which is normally under the history tab on your right hand side of the interface assuming default tool placements use the icon that says create action. Hit the record button sort of like making a Macro in other apps, open one of the files in question in fact you can actually already have it open before you hit record in any case, the record needs to be on when you do the save as to your target directory. After it has recorded you doing the 'save as action' with the settings you wanted hit the stop recording button. Save the Action, you should now be able to use it from the batch menu under File > Automate > Batch, select your new action, select the source directory and the target directory, let photoshop do the rest. I can give a more detailed description if you get stuck anywhere; these instructions assume Adobe Photoshop 8.0 (CS1).

That's way more involved than it needs to be. Just use image processor.
...
 
Momento Mori
Gerbil First Class
Posts: 194
Joined: Tue Sep 09, 2008 5:25 pm
Location: Northeast Ohio

Re: Batch image convertion (tif to jpg or png)

Fri Apr 17, 2009 1:10 pm

It sounds harder than it actually is, it is very quick process in Photoshop.
Image
 
mattsteg
Gerbil God
Posts: 15782
Joined: Thu Dec 27, 2001 7:00 pm
Location: Applauding the new/old variable width forums
Contact:

Re: Batch image convertion (tif to jpg or png)

Fri Apr 17, 2009 1:19 pm

Momento Mori wrote:
It sounds harder than it actually is, it is very quick process in Photoshop.
I understand that, but its not easier than using the facility already built into photoshop for just this sort of thing.
...
 
Momento Mori
Gerbil First Class
Posts: 194
Joined: Tue Sep 09, 2008 5:25 pm
Location: Northeast Ohio

Re: Batch image convertion (tif to jpg or png)

Fri Apr 17, 2009 6:57 pm

I suppose that is true, I guess I just think of batch jobs by default... must be the programmer day job.
Image
 
jolt256
Gerbil
Posts: 40
Joined: Wed Aug 17, 2005 3:31 am

Re: Batch image convertion (tif to jpg or png)

Fri Apr 17, 2009 7:16 pm

flip-mode wrote:
And now it's installed. Heh. I love Ubuntu.


Here's a one-liner that'll (probably?) do what you want:

find . -name '*.tif' | perl -pi -e 'print $_; $_ =~ s/tif/png/;' | xargs -n 2 convert


Finds all .tif files below the current directory,and creates a PNG version with the same name but new extension. If you want JPEG, just change the 'png' in the perl command to 'jpg'. If you have multiple processors, you can do the conversion in parallel as follows: (for example, over 4 CPUs)


find . -name '*.tif' | perl -pi -e 'print $_; $_ =~ s/tif/png/;' | xargs -n 2 -P 4 convert


Who said Photoshop is easier than the CLI? :D
 
Nitrodist
Grand Gerbil Poohbah
Posts: 3281
Joined: Wed Jul 19, 2006 1:51 am
Location: Minnesota

Re: Batch image convertion (tif to jpg or png)

Mon Apr 27, 2009 2:07 am

Momento Mori wrote:
In Photoshop all you need to do is go to the actions tab, which is normally under the history tab on your right hand side of the interface assuming default tool placements use the icon that says create action. Hit the record button sort of like making a Macro in other apps, open one of the files in question in fact you can actually already have it open before you hit record in any case, the record needs to be on when you do the save as to your target directory. After it has recorded you doing the 'save as action' with the settings you wanted hit the stop recording button. Save the Action, you should now be able to use it from the batch menu under File > Automate > Batch, select your new action, select the source directory and the target directory, let photoshop do the rest. I can give a more detailed description if you get stuck anywhere; these instructions assume Adobe Photoshop 8.0 (CS1).


That's what I do, except I use the "Save for Web" thing to give me a preview. Then I use Adobe Bridge to rename the files to whatever I want.
Image

Who is online

Users browsing this forum: No registered users and 13 guests
GZIP: On