PDA

View Full Version : LZW or other Compression



Ron McElroy
8-Jun-2010, 07:45
I've always saved my images at full resolution. I'm about to fill up yet another hard drive so I looking into saving images with compression. I've been told that LZW is lossless. Anyone using it and what are your opinions?

harlekin
8-Jun-2010, 07:54
LZW (Lempel-Ziv-Welch) is indeed a lossless compression scheme. It is quite old, having been used since the early 80's. I would assume you are working with TIFF files if LZW is being presented as an option. I think the only standard compression formats for TIFF are JPEG and LZW.

Depending on your purpose, you could get smaller file sizes out of a more modern lossless format like PNG or JPEG2000 (though JPEG2000 hasn't really taken off for some reason.) LZW compressed TIFF files will give you no problems though.

Ken Lee
8-Jun-2010, 08:11
If you use Photoshop, you can use PSD, which is a lossless compression algorithm.

bsimison
8-Jun-2010, 09:37
I haven't saved TIFFs with LZW in several years, so I just did a quick save test with a 16-bit, 37MB file I currently had open in Photoshop. These are the actual file sizes on disk:

TIFF, no compression: 37,473,624 bytes
TIFF, LZW compression: 48,838,428 bytes
TIFF, ZIP compression: 36,681,304 bytes
PSD, standard: 37,476,176 bytes

You might want to perform your own tests and see what happens. You don't get a lot of savings with TIFF compression (you may actual gain bytes with LZW, at least in my test!).

-Brett

Tom Monego
8-Jun-2010, 11:28
LZW works with 8 bit files well. LZW doesn't play with 16 bit files well at all, learned this very quickly when i started using digital, and scanning LF at 16 bits.

Tom

harlekin
8-Jun-2010, 11:40
LZW is the same compression scheme used in GIF files. It certainly works best on 8 bit files, but more importantly, it is optimized for images with solid color fields. The same holds true for the PNG format. If you have line-art with few colors you will get a very small file size (and this sort of image looks godawful in JPEG format.) Unfortunately, photographs tend to have continuous tonal shifts, which don't play well with this sort of compression.

ZIP is a good general purpose compression format, but it is really best optimized for flatform text files, so photos will only get moderate compression.

JPEG is designed for photographs, so has good quality and compression, but it is lossy. JPEG2000 has a very nice photographic compression scheme that supports a lossless format. JPEG2000 is supported by Photoshop and all of the major graphic arts software, but little else. On the other hand, JPEG2000 isn't a format designed for working files. I don't believe that it has support for layers a-la TIFF and PSD. As an archival format it may be acceptable, as long as you're careful to use the lossless settings. (I know PS supports it, but I've only actually played with JP2 in Corel's software).

Ken Lee
8-Jun-2010, 15:31
8-bit RGB

TIFF with no compression: 3.78 MB
Same image saved as PSD: 1.7 MB

PSD uses lossless compression. It is not the same as TIFF.

Ron McElroy
8-Jun-2010, 17:04
Thanks for replies everyone. Looks like I need to do some testing when I get home. I hadn't thought of saving as PSD files.