View Single Post
Old 02-26-2013, 02:11 PM   #20
psyang
Powerplay Quarterback
 
Join Date: Jan 2010
Exp:
Default

Quote:
Originally Posted by Hack&Lube View Post
So the highest compression seems to result from zipping via PPMd algorithm but that makes it difficult for the business to use files since they will have to unzip them.

Fortunately, I've found saving as a LZW compressed tif (lossless) via GIMP/Imagemagick results in a file that is still about 60-75% smaller on average.

Now I need to make a script to batch this job across several folders. Either imagemagick or gimp would work but I can't make the command line batch process work.

Any ideas? For Imagemagik, the following works:

Code:
convert -compress lzw source.tiff destination.tiff
but how can I use wildcards so it will just for instance compress everything in C:\IN and put the same files into C:\OUT? (I'll mount network locations to these folders). I've tried various of *, %, and $ but I think I'm doing it wrong. Any ideas?
It's been a while since I've done DOS batch files, but look at the FOR command - you can use it to specify a group of files (wildcarded) and issue a command against each matched file. Maybe something like:

Code:
FOR %file in (c:\in\*.tiff) do convert -compress lzw c:\out\%~nfile
psyang is offline   Reply With Quote