TIFF files with LZW, ZIP, and JPEG compression

Started Dec 1, 2015 | Questions
gkreth Veteran Member • Posts: 3,122
TIFF files with LZW, ZIP, and JPEG compression

So, I understand that JPEG is a lossy format.

And I understand that TIFF is a lossless format.

Further, I also understand that, when TIFF files are saved with LZW or ZIP compression, the compression is lossless.

What I *DON'T* know is: When a TIFF file is saved using JPEG compression, is the resulting file lossy?

Maybe another way of asking it is: Why is JPEG offered as a compression option with the TIFF format? If TIFF with JPEG compression is lossy, why not just save the file as a JPEG?

Update/addendum: I did a bit more reading, and I found a reference to "uncompressed JPEG" I know that there are levels of compression, but I always assumed that, even at the highest quality levels, there was still some loss.

Thanks for any light you all can shed on this.

Greg

ANSWER:
This question has not been answered yet.
mclewis Senior Member • Posts: 1,398
Re: TIFF files with LZW, ZIP, and JPEG compression
1

JPEG compression is always lossy.  Using JPEG compression in a TIFF file results in lossy compression as you thought.  I would never use it.  As to why it is an option I don't know really, apart from that it would produce smaller file sizes.

Law251
Law251 New Member • Posts: 16
Re: TIFF files with LZW, ZIP, and JPEG compression

gkreth wrote:

So, I understand that JPEG is a lossy format.

And I understand that TIFF is a lossless format.

Further, I also understand that, when TIFF files are saved with LZW or ZIP compression, the compression is lossless.

What I *DON'T* know is: When a TIFF file is saved using JPEG compression, is the resulting file lossy?

Maybe another way of asking it is: Why is JPEG offered as a compression option with the TIFF format? If TIFF with JPEG compression is lossy, why not just save the file as a JPEG?

Update/addendum: I did a bit more reading, and I found a reference to "uncompressed JPEG" I know that there are levels of compression, but I always assumed that, even at the highest quality levels, there was still some loss.

Thanks for any light you all can shed on this.

Greg

It's a good question, why have JPEG compression for a TIFF? Maybe someone now has the answer?  Incidentally, Epson Scan offers JPEG(7) as an option when saving to TIFF...

Steve Bingham
Steve Bingham Forum Pro • Posts: 27,675
Re: TIFF files with LZW, ZIP, and JPEG compression

Tiff files can be 16 bit. Jpg files are always 8 bit. A jpg file throws away 8 bit, never to be recovered. LZW and ZIP are rarely used and also throw away information.

-- hide signature --

Steve Bingham
www.dustylens.com
www.ghost-town-photography.com
Latest postings are always at the bottom of each page.

 Steve Bingham's gear list:Steve Bingham's gear list
Nikon Coolpix 990 Nikon D810 Nikon D7200 Nikon AF Nikkor 85mm f/1.8D Fujifilm XF 60mm F2.4 R Macro +32 more
nelar Junior Member • Posts: 42
Re: TIFF files with LZW, ZIP, and JPEG compression
2

Steve Bingham wrote:

Tiff files can be 16 bit. Jpg files are always 8 bit. A jpg file throws away 8 bit, never to be recovered. LZW and ZIP are rarely used and also throw away information.

Er, not sure why you think LZW and ZIP throw away information. There is nothing in these algorithms that allows for discarding of any information -- all the information is 100% restored when decompressed. That's why these two algorithms are so widely used -- not just for images, but text, executables, binary data, etc. -- all kinds of things where losing even a single byte of information would make the entire file useless.

Also, the JPEG algorithm does NOT throw away 8 bit information -- it simply cannot compress a 16 bit image. That's why when you try to save a 16-bit TIFF file from Photoshop, the JPEG option will be greyed out. You must first lower the image depth to 8-bit before the JPEG option is available.

Steve Bingham
Steve Bingham Forum Pro • Posts: 27,675
Re: TIFF files with LZW, ZIP, and JPEG compression

nelar wrote:

Steve Bingham wrote:

Tiff files can be 16 bit. Jpg files are always 8 bit. A jpg file throws away 8 bit, never to be recovered. LZW and ZIP are rarely used and also throw away information.

Er, not sure why you think LZW and ZIP throw away information.

Very True. However, LZW seems to work with many files NOW that it stumbled with 10 years ago. It especially works well with solid colors, like black. LZW does not work at all well with 16-bit files with tons of detail and different shades and often makes them larger. On the other hand, ZIP files seem to do just fine.

There is nothing in these algorithms that allows for discarding of any information -- all the information is 100% restored when decompressed. That's why these two algorithms are so widely used -- not just for images, but text, executables, binary data, etc. -- all kinds of things where losing even a single byte of information would make the entire file useless.

Also, the JPEG algorithm does NOT throw away 8 bit information -- it simply cannot compress a 16 bit image. That's why when you try to save a 16-bit TIFF file from Photoshop, the JPEG option will be greyed out.

This is flat wrong. It is NOT greyed out! My files are saved as tiff files. Later they are converted from 16 bit tiff to 8 bit jpg, after they are tweaked for maximum effect.

You must first lower the image depth to 8-bit before the JPEG option is available.

Photoshop does this automatically. Click. Done.

-- hide signature --

Steve Bingham
www.dustylens.com
www.ghost-town-photography.com
Latest postings are always at the bottom of each page.

 Steve Bingham's gear list:Steve Bingham's gear list
Nikon Coolpix 990 Nikon D810 Nikon D7200 Nikon AF Nikkor 85mm f/1.8D Fujifilm XF 60mm F2.4 R Macro +32 more
nelar Junior Member • Posts: 42
Re: TIFF files with LZW, ZIP, and JPEG compression

Must be a different version of Photoshop. I have CC 15.5, and the Jpeg option is greyed out if the image is 16 bit. Which, IMHO, is as it should be. Having the bit depth automatically lowered when you choose a compression option would be easy to miss.

I'm not arguing the value of LZW or ZIP, just that they do not lose any information. The choice of when/whether to use LZW or ZIP goes far beyond the subject of this thread.

JohnWheeler Contributing Member • Posts: 599
Re: TIFF files with LZW, ZIP, and JPEG compression

Using JPEG does save space and using TIFF with JPEG also saves space and allows you to still keep your layers.

I think the savings is marginal yet that could vary by image or by the need by the user.

I never used JPEG compression with TIFF

-- hide signature --

John Wheeler

Steve Bingham
Steve Bingham Forum Pro • Posts: 27,675
Re: TIFF files with LZW, ZIP, and JPEG compression

nelar wrote:

Must be a different version of Photoshop. I have CC 15.5,

Maybe. I am using CC 2017.1.1. As Adobe updates automatically, I CAN understand using earlier versions. Some of the later versions don't always work on current video cards, etc.

and the Jpeg option is greyed out if the image is 16 bit. Which, IMHO, is as it should be. Having the bit depth automatically lowered when you choose a compression option would be easy to miss.

I'm not arguing the value of LZW or ZIP, just that they do not lose any information. The choice of when/whether to use LZW or ZIP goes far beyond the subject of this thread.

-- hide signature --

Steve Bingham
www.dustylens.com
www.ghost-town-photography.com
Latest postings are always at the bottom of each page.

 Steve Bingham's gear list:Steve Bingham's gear list
Nikon Coolpix 990 Nikon D810 Nikon D7200 Nikon AF Nikkor 85mm f/1.8D Fujifilm XF 60mm F2.4 R Macro +32 more
Keyboard shortcuts:
FForum MMy threads