Pages: [1]   Go Down

Author Topic: JPEG vs. TIFF, does it matter?  (Read 4346 times)

NAwlins_Contrarian

  • Full Member
  • ***
  • Offline Offline
  • Posts: 233
JPEG vs. TIFF, does it matter?
« on: March 04, 2018, 10:50:18 pm »

In the recent thread "Can you Recommend which settings to use for Large Prints" (http://forum.luminous-landscape.com/index.php?topic=123556.0), there was a discussion about whether it was better to send for printing 16-bit TIFF instead of a best-quality JPEG. My belief is that unless the lab or person printing it is going to make some pretty substantial adjustments--more than just converting to a profile for the printer+ink+paper--it is highly unlikely to matter. I decided to test that.

I started with Bill Atkinson's printer test page--well-known to many of you and available from its creator as a high-resolution (about 80 MP) TIFF in L*a*b color representation--seemed like a good choice from my Lightroom catalog. In Lightroom 6.14, I outputted four versions of it, all scaled to 10 inches at 360 ppi on the long side: (1) a 16-bit TIFF in ProPhoto RGB, (2) a maximum-quality JPEG in ProPhoto RGB, (3) a 16-bit TIFF in sRGB, and (4) a maximum-quality JPEG in sRGB. I don't have PhotoShop, so I used Affinity Photo 1.6.3 to prepare the comparisons. First I opened files (2), (3), and (4); second I converted the two files in sRGB to ProPhoto RGB; and third I saved each file as a 16-bit TIFF. So all of my test images were now available as 16-bit TIFFs in ProPhoto RGB, but two of them had been JPEGs in an intermediate version, and two had been sRGB in an intermediate version. Then I closed all the files and made them read-only.

As a control / extreme case, I opened the file that had always been a 16-bit TIFF in ProPhoto RGB, opened the filed that had been a JPEG in sRGB in an intermediate version, inverted the latter, copied it, pasted it as a new layer in the former, then changed the mode of dealing with the multiple layers from Normal to Add. The result is attached (as a JPEG in ProPhoto RGB color space--which some browsers don't handle correctly--saved at 99% to get under the 4 MB files size limit), and here you can see the test images have a fair amount of content outside of sRGB.

But how much difference does JPEG versus 16-bit TIFF make, if both are in ProPhoto RGB? That result is also attached (again, as a JPEG in ProPhoto RGB color space saved at 99%). Do you see any differences? I don't, I just see a white page. Dragging it around on-screen at 100%, I still didn't notice any differences. No, I didn't do any further snooping around with a threshold or anything to try to tease out what would have to be very subtle differences, if there are any. So if there are any differences (and theoretically there should be), the differences appear to be less than the 8 most significant bits.

I conclude--IMOPO--if you can use ProPhoto RGB (or Adobe RGB) for a TIFF but have to limit a JPEG to sRGB, then sure, there will be some differences, albeit usually fairly subtle ones. However, with anything approaching normal pictorial content, I don't think many if any of us could reliably detect differences between prints made from a 16-bit TIFF and prints made from a maximum-quality JPEG, as long as each uses the same color space.
Logged

digitaldog

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 21651
  • Andrew Rodney
    • http://www.digitaldog.net/
Re: JPEG vs. TIFF, does it matter?
« Reply #1 on: March 05, 2018, 10:41:38 am »

The late, great Bruce Fraser was hired decades ago by Kodak to test ProPhoto RGB and came to similar conclusions with respect to editing that data (not necessarily conversion after to JPEG); not ideal for editing outside of a high bit path but doable with (depending on the kinds of edits) minor degradation. So not recommended blindly but not quite a poke in the eye with a sharp stick. If you've got high bit data, ProPhoto RGB edit there. But if you don't, it isn't the end of the world.
Logged
http://www.digitaldog.net/
Author "Color Management for Photographers".

Doug Gray

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2205
Re: JPEG vs. TIFF, does it matter?
« Reply #2 on: March 05, 2018, 12:37:43 pm »

The late, great Bruce Fraser was hired decades ago by Kodak to test ProPhoto RGB and came to similar conclusions with respect to editing that data (not necessarily conversion after to JPEG); not ideal for editing outside of a high bit path but doable with (depending on the kinds of edits) minor degradation. So not recommended blindly but not quite a poke in the eye with a sharp stick. If you've got high bit data, ProPhoto RGB edit there. But if you don't, it isn't the end of the world.
Exactly, and the increase in storage capacity and bandwidth since Bruce's day has made high bit workflows essentially free. So work in 16 bits and use jpegs for the final product if forced without much worry. The process control of an outside printer will always be a much bigger issue. If one is concerned at that level the first steps should be to do your own printing with a completely color managed workflow. That's where the low hanging fruit is.
Logged

NAwlins_Contrarian

  • Full Member
  • ***
  • Offline Offline
  • Posts: 233
Re: JPEG vs. TIFF, does it matter?
« Reply #3 on: March 05, 2018, 11:58:08 pm »

Thanks for the replies, gents.

As a further test / clarification, I went ahead an applied a threshold adjustment (in Affinity Photo 1.6.4, Layer -> New Adjustment Layer -> Threshold Adjustment) to the original versions (i.e., 16-bit TIFFs, not JPEGs) of the two files I posted above--to make any changes easy to see. First I tried a threshold of 95%, and still saw all white--no differences of 5% or more, at least that I noticed. Then I tried a threshold of 99%, i.e., a difference of 1%, and found a slight peppering of black dots, indicating pixels where the JPEG differed from the TIFF by 1% or more, but less than 5%. Finally I tried a threshold of 99.6%,* which is right at the limit of what you can represent with 8 bits**--and a lot of pixels were black, indicating some difference. All three graphic outputs are attached, in order. These results are far easier to digest than are trying to visually assess shades of off-white, which is what my prior post gave you. Hopefully you'll find the new versions useful.

What do they show? Well, are you a 'glass half empty' or a 'glass half full' sort of person? As far as I noticed, no pixel showed a difference of 5% or more between the ProPhoto RGB JPEG and the ProPhoto RGB 16-bit TIFF. The fraction of pixels that showed a 1% difference appears to be very small (probably not 1 in 1000 pixels, and certainly not 1 in 100 pixels), and very scattered around. not contiguous. On the other hand, the fraction of pixels showing a difference that 8-bit graphics can represent was not trivial--far fewer than half, but my visual guestimate says maybe 5% or 10%.

So even if you print on a printer / through a printer driver that is limited to 8-bit precision, it appears that it would be inaccurate to say that there is no difference between a ProPhoto RGB JPEG and a ProPhoto RGB 16-bit TIFF. On the other hand, I feel quite comfortable saying that the differences are so small that 95+% of us could not reliably detect them in 95+% of photographic images.

* Affinity Photo only displays thresholds in even percents, e.g., 99% or 100%. However, the on-screen appearance shows quite clearly that it is performing the appropriate, and different, operations depending on whether you set the threshold to, e.g., 99.6% or 99.9%.

** I realize that an '8 bit' color image uses 8 bits for each of the red, green, and blue channels. So there are 256 possible values (0 to 255) per channel. I'm assuming that a change of 1 out of 256 or 0.4% in any of the three channels would be 'picked up' by the 99.6% threshold, but I don't know exactly what Affinity Photo is doing, math-wise.
« Last Edit: March 06, 2018, 12:03:50 am by NAwlins_Contrarian »
Logged

Doug Gray

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2205
Re: JPEG vs. TIFF, does it matter?
« Reply #4 on: March 06, 2018, 08:54:39 pm »

I've run some experiments converting 8 bit tiffs to 8 bit jpegs (max quality). I've also run some tests on how much error is introduced by converting high bit tiffs to 8 bit tiffs. Converting an 8 bit tiff to jpeg in sRGB introduces slightly more error than converting high bit tiffs in ProPhoto to 8 bit ProPhoto tiffs.

Turns out the conversion to jpeg introduces an average error that is over twice that compared to converting a high bit tiff to an 8 bit tiff in the same RGB colorspace. And the maximum errors are over 5 times larger with jpegs.

I have seen jpeg errors that were visible but it's pretty rare.

I ran some tests on an old 16 bit, 10MP file in ProPhoto RGB. It was compared to an 8 bit tif file and an 8 bit jpeg, both converted directly from Photoshop.

Ave DeltaE2000 error was .39 for the 8 bit tif conversion and .89 for the jpeg.

Attached are histograms of the error distributions.
« Last Edit: March 07, 2018, 12:28:53 am by Doug Gray »
Logged

kers

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 4602
    • Pieter Kers
Re: JPEG vs. TIFF, does it matter?
« Reply #5 on: March 07, 2018, 03:47:29 am »

What i have noticed you should use tiff in the case of geometrical forms for they get sloppy.
For instance perfect straight lines. In jpeg they get distorted.
Usually the LZW-compressed 8 bit tifs of these kind of images are small too.
In photography however a high quality jpeg can be used without being noticed.
Sensitive area's are soft gradients in color and luma- skies etc
« Last Edit: March 07, 2018, 03:51:27 am by kers »
Logged

Doug Gray

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2205
Re: JPEG vs. TIFF, does it matter?
« Reply #6 on: March 07, 2018, 12:33:13 pm »

What i have noticed you should use tiff in the case of geometrical forms for they get sloppy.
For instance perfect straight lines. In jpeg they get distorted.
Usually the LZW-compressed 8 bit tifs of these kind of images are small too.
In photography however a high quality jpeg can be used without being noticed.
Sensitive area's are soft gradients in color and luma- skies etc
I've never noticed any degradation issue on my own printed jpegs but it's been a very long time since I did precision printing using jpegs.  I have seen subtle, but visible, banding with the highest quality jpegs that others made. The nature of jpeg encoding is such that fairly large deviations can occur even though rarely visible. In tiff images, the worst case converting from high bit to 8 bit is well defined. It is where rounding occurs right at the boundary of .5 in all three RGB channels and when that occurs in the most perceptually sensitive location of an RGB colorspace. This is, of course, greatest in very large colorspaces such as ProPhoto RGB. Interestingly, the errors introduced in jpeg sRGB images are still larger than those introduced in 8 bit tiff images in ProPhoto RGB.

The Color Settings also affects conversions but only a tiny amount. This is the worst case in my image going from high bit to 8 bit tiffs:

Worst case with dither selected:
ppRGB high bit (19.0117   18.9572   15.1829)   Converted to 8 bit (19.0000   18.0000   15.0000)  dE00   2.6751     Ave dE00 .39

Worst case w/o dithering:
ppRGB high bit (20.4903   18.5058   12.4981)  Converted to 8 bit (20.0000   19.0000   12.0000)   dE00:  2.6069     Ave dE00 .37

Selecting dithering s/b done because it reduces potential banding over smooth gradients. While rarely visible, there are cases where it can be seen if you happen to have gradients in the most sensitive areas of an RGB space. It's really rare though.
« Last Edit: March 07, 2018, 04:52:42 pm by Doug Gray »
Logged
Pages: [1]   Go Up