LZW Compression on Tif files

Hi,
This is probably the wrong forum but I thought I’d try you guys first.

Does anyone know how I can compress a tif file using LZW via a command line and if so how?

cheers

dave

:oops:

try tiffutil

no man pages for it though, but if you enter tiffutil at the command line without anything else it will give you a few clues as to what you need to do.

Kevin

Thanks Kevin that works for CMYK tifs.

I dont suppose you know if there is anything out there that can handle tifs with alpha channels?

Cheers

Dave

tiffutil works for me for compressing TIFFs with alpha channels using LZW:

Jon


[This script was automatically tagged for color coded syntax by Script to Markup Code]

Hi Jon,
Thanks for the script but it generates the following for my tif files.

tell current application
choose folder with prompt “Choose a folder full of TIFFs”
→ alias “dave.roberts:Users:davrob:Desktop:mirjan:”
list folder “dave.roberts:Users:davrob:Desktop:mirjan:” without invisibles
→ {“TestLZWNo.tiff”}
do shell script “tiffutil -lzw ‘/Users/davrob/Desktop/mirjan/TestLZWNo.tiff’ -out ‘/Users/davrob/Desktop/mirjan/TestLZWNo.tiff’”
→ TIFF Error: Cannot handle 5-channel data.
Error: Can’t open /Users/davrob/Desktop/mirjan/TestLZWNo.tiff. Either it isn’t a TIFF file, or there are unrecognized tags; try tiffutil -dump for more info.
No output file created due to errors.

Any clues? :frowning:

I’m using a 5 channel TIFF I created in Photoshop, here are my results:

Perhaps you have a permissions problem or maybe a version issue with tiffutil. Try commenting out the first tiffutil line and just getting the verbose info on the file to see if there is anything interesting in there.

Jon


[This script was automatically tagged for color coded syntax by Script to Markup Code]

Where do you get this program? I have done a quick search on the Web, but havent found a download site for it.

If you are referring to “tiffutil”, it’s part of the BSD subsystem (Unix command line)

Jonn,

Many thanks, that verbose setting really helped, it turns out that one particular tif file was a greyscale alpha channel and thats what wouldnt convert.

Is there any way of increasing the compression? The size is much less if saved from Photoshop?

Also do you know if there is a similar command available for IRIX?

Cheers

Dave