Forgot Password
Pentax Camera Forums Home
 

Reply
Show Printable Version Search this Thread
12-01-2015, 02:57 PM   #1
Forum Member




Join Date: Jul 2009
Location: Austin, TX
Posts: 68
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

12-01-2015, 04:01 PM   #2
Pentaxian




Join Date: Nov 2011
Location: East central Indiana
Photos: Gallery
Posts: 893
TBH here, I don't have a clue.


When I save as a Tiff file, I save it with none checked.


It wasn't until the other day that I figured out why I couldn't save my photos as jpegs in PSE. Now that I know that, I won't be stripping the EXIF data from my photos.
12-01-2015, 04:38 PM   #3
Site Supporter
Site Supporter
RGlasel's Avatar

Join Date: Sep 2013
Location: Saskatoon
Photos: Gallery | Albums
Posts: 3,228
QuoteOriginally posted by gkreth Quote
I always assumed that, even at the highest quality levels, there was still some loss.
I had to look this up and I'm afraid the answer is "it depends." The TIFF standard allows different software to implement compression in different ways, as long as the implementation is one of seven types. To make matters worse, there are several compression methods adopted as part of the JPEG standards, and as long as one of those methods is used, it qualifies as JPEG compression in a TIFF file. Lossless JPEG compression is close to 100% lossless, but it uses a statistical prediction that may not be accurate 100% of the time. There is also JPEG 2000 which is another method of lossless compression. With continuous tone images, lossless JPEG achieves about 2:1 compression, which is sometimes better than LZW or ZIP compression, but not always and LZW and ZIP are faster algorithms that always decode with 100% accuracy. I assume that your screenshot is from PhotoShop, in which case a lossy form of JPEG compression is used to get better compression at the cost of slightly less than 100% accuracy when decoded.
12-01-2015, 11:18 PM   #4
Pentaxian
Bengan's Avatar

Join Date: Nov 2012
Location: Stockholm
Photos: Gallery | Albums
Posts: 1,756
The short answer is that TIFF can be saved either "uncompressed" with no data loss or "compressed" with different degrees of data loss depending on the level of compression.
If you're interested in a really long answer there is a comprehensive article here: https://en.wikipedia.org/wiki/Tagged_Image_File_Format

12-02-2015, 08:53 AM   #5
Senior Member




Join Date: Feb 2014
Location: Vancouver, BC
Posts: 108
QuoteOriginally posted by gkreth Quote
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
TIFF isn't really a format they way JPEG or PNG are--it's more of a container that sets standards for the structure of metadata and image data, but has multiple options for how the image data is stored. "Uncompressed TIFF" is lossless (and of course huge), and readable by anything that can read a TIFF file; other compression schemes, both lossy and lossless, are permitted, but not all software can read them (they should all read PackBits and CCIT Group 3, which are relatively inefficient and monochrome, respectively). Most modern software can handle ZIP, LZW, and JPEG (there are also some exotic compression schemes that are rarely used)--but there's very little reason to use JPEG TIFFs nowadays: if you want a JPEG file you make one, but you're generally using TIFF because you want to preserve more data, including layers, multiple pages, etc.
12-02-2015, 09:48 AM   #6
Site Supporter
Site Supporter
RGlasel's Avatar

Join Date: Sep 2013
Location: Saskatoon
Photos: Gallery | Albums
Posts: 3,228
QuoteOriginally posted by Bengan Quote
either "uncompressed" with no data loss or "compressed" with different degrees of data loss depending on the level of compression.
Compression is possible without any loss of information, with ZIP, LZW or similar lossless compression methods, but the degree of compression is limited to 2:1 in most situations. If the data repeats itself, mathematical formulas can encode data using fewer bytes and decode the data without any loss. Lossy compression in JPEG files can compress the data as much as 10:1 without noticeable loss of detail (not noticeable to human eyes, that is), depending again on the type of image, and if the "quality" is reduced, compression ratios of 100:1 are possible. As bar_foo says, the TIFF standard is basically a standard for a container that contains either uncompressed image data or data compressed according to a set of allowable compression methods. As bar_foo also says, there is very little reason to use JPEG compression in a TIFF file, it is almost certainly going to be lossy compression and the main reason for using TIFF files is for compatibility between different software. There is a good chance that software that wasn't used to generate a particular TIFF file with JPEG compression will not be able to read it, which totally defeats the compatibility advantage of TIFF files.

It's slightly off topic, but if you plan to compress an image and edit it later, I strongly suggest you don't save it as a JPEG file. Ugly artifacts are created every time the image data is decoded and encoded again because of the lost information. If you want to edit your images later in a different program, your best choice is to save the image as a TIFF file using either LZW or ZIP compression. What I mean by editing is even something as simple as expanding the image dimensions from the dimensions it was saved in.
12-02-2015, 01:04 PM   #7
Forum Member




Join Date: Jul 2009
Location: Austin, TX
Posts: 68
Original Poster
Thanks for the replies!

Thanks for all the replies, everyone!

Background on how my question came up: I was editing pictures in FastStone, which has become my free-but-simple-and-still-powerful image editor of choice. I used to use IrfanView, but FastStone had some very nice features that either are not in IrfanView, or handle it better than IrfanView:
  1. FS has VERY NICE shadow and highlight faders.
  2. FS has a nice feather-like value for it's Clone tool; IV's is pretty hard-edged.

I've tried GIMP and PSPX, but honestly, they are simply too complicated for me. I used to think layers were a must-have feature, but I've since realized that I just don't do that heavy a level of editing. Mostly I just do:
  1. shadow/highlight tweaking
  2. sometimes some slight color correction (from too much/little saturation)
  3. slight rotation to fix slightly crooked pictures
  4. cropping (usually to get better composition)
  5. resizing (for Picasa/Facebook sharing)

These are mostly pics of family gatherings, or high school band pics of my kids.

One of the things that I like to do is to combine pics in "action sequence," e.g., something like this:


If I have no other edits other than cropping/resizing, I do it all in IrfanView, because the workflow is a little faster for me. As I go along, though, I like to save my work after adding each new image to the composite, and I normally save them as a TIFF (instead of doing multiple saves on a JPEG). My final save of the composite is always a JPEG.

But sometimes, the edits require more work (e.g., if every picture in the sequence is slightly crooked); in those cases, I do the initial edits in FastStone, save each file as a TIFF, and them combine them using IrfanView.

When saving the TIFF files, I noticed the compression options:


As you mouse over each compression type, the screen updates to show you what the picture would look like, and what the new file size would be.

I was intrigued by how small the resulting file was with the JPEG compression option:


I could not see any artifacts, and the file size was actually smaller than the original OOC JPEG. I started to wonder if I could batch process whole directories of JPEGs, saving them as TIFFs using JPEG compression.

But, from the subsequent posts, I'm pretty sure now that TIFFs with JPEG compression are no better than JPEGs, and are not worth the time and effort to batch convert. Plus, although photos will open in FastStone, I tested saving a TIFF with JPEG compression, and i could not open it in IrfanView; so, the format is not easily transferable to other applications.

So, I'm scrapping the idea; it was an interesting experiment, but not worth pursuing further, I think.

Greg

12-21-2015, 07:16 AM   #8
Unregistered User
Guest




Good description of TIFF here:
TIFF: Summary from the Encyclopedia of Graphics File Formats

scroll down to the part about compression, in particular. main website has links to information about all sorts of image data file formats.
Reply

Bookmarks
  • Submit Thread to Facebook Facebook
  • Submit Thread to Twitter Twitter
  • Submit Thread to Digg Digg
Tags - Make this thread easier to find by adding keywords to it!
compression, file, format, jpeg, levels, lossless, photography, photoshop, tiff, tiff files

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sky posterization/banding caused by JPEG compression RayeR Digital Processing, Software, and Printing 20 04-04-2014 08:08 AM
Saving JPEG to TIFF? slackercruster Digital Processing, Software, and Printing 15 04-17-2012 09:46 AM
Picture folder compression ZIP? SlickYamaha Troubleshooting and Beginner Help 5 07-24-2011 06:02 PM
K-x JPEG Compression Nightwings Pentax DSLR Discussion 8 08-02-2010 04:19 PM
Jpeg compression quality Cambo Pentax DSLR Discussion 4 06-01-2008 03:19 AM



All times are GMT -7. The time now is 06:41 PM. | See also: NikonForums.com, CanonForums.com part of our network of photo forums!
  • Red (Default)
  • Green
  • Gray
  • Dark
  • Dark Yellow
  • Dark Blue
  • Old Red
  • Old Green
  • Old Gray
  • Dial-Up Style
Hello! It's great to see you back on the forum! Have you considered joining the community?
register
Creating a FREE ACCOUNT takes under a minute, removes ads, and lets you post! [Dismiss]
Top