Question about PNG vs TIFF

I usually export my images as 16 bit TIFF files, but today I was doing some panorama stitching projects. With my first attempt I exported the individual images from DT as TIFF to be used for stitching. With my second attempt I decided to use PNG so I could tell them apart easily from my first attempt. I guess my question is what is the significant differences between a TIFF and a PNG file that I should be aware of when working with darktable.

1 Like

as both are lossless there’s no difference if it‘s about darktable. But there might be tools or print shops around not supporting each variant of those …

Thanks @MStraeten for your reply. I am surprised no one else had any thoughts or knowledge about PNG vs TIFF. It is certainly convenient for me to export PNG files when working a series of images for panorama as it lets me know that they are not the finished product. And it seems there is no disadvantage doing a PNG compared to a TIFF.

This may help:

3 Likes

@martbetz thanks for a link with a very definitive answer to my question. It is worth the read for anyone else who has the same question or doesn’t know the answer.

2 Likes

Thanks for bringing this up Terry… never really thought about it for some reason. :slight_smile:

16-bit, either format. Down-sampling to 8 bits loses a lot of data needed for low-damage editing…

1 Like

For me it was really about using DT to process the RAW files that I want to stitch together in another program. Exporting them as a PNG is convenient because I can then realise they are not a finished product. I stitch them together and export the panorama as a TIFF and then I know that is a finished product.

I would never do an 8 bit TIFF and I groan when I have to edit a JPG. I have often wondered about 32 bit floating point TIFFs and if there is any real advantage to them. 16 bit seems more than adequate I would have thought but I defer to more knowledgeable people if they say different.

Yeah, it was more of a public-service announcement…

I personally think 16-bit is plenty, as the largest bit-depth delivered by modern general-purpose cameras is 14-bit. Now, internally I think float is prudent, both for the precision of editing results as well as the absence of a relevant upper and lower value bound.

Are you will to elaborate on this? I am always interested in learning. I just presumed with 16 bit everything is covered so what was the advantage of floating point.

For photos, PNG is quite slow to write. TIFF can be with no compression which is very fast, or zip compression which is quite fast, and still lossless. TIFF files can use lossy JPEG compression (yuck).

PNG is integer-only, which is okay for final display-referred data, but can’t record values outside the range of 0 to 100% of white. TIFF can be floating-point, and has no practical limit on the range of values. 32-bit floating point has more precision than 16-bit integer, which is useful for some purposes such as HDR and displacement maps.

3 Likes

it depends on your expectation: is it good enough?
How much leeway do you need for editing? 8 bit seems to be enough for most users (there’s a reason why jpg is so popular) 16 bit or 32 bit float allows finer edits of very subtle tonal ranges without banding …
You can drive with a 40tons truck to do your shopping tour, but for most users a cheap car is sufficient :wink:

Typical 16-bit image data is clamped between 0 and 65535, corresponding respectively to black and white. Floating point image data is usually represents the same black-white range as 0.0-1.0, because this is the floating point range with the least quantization. The big difference between the two is that data can be expressed outside either of those two bounds, letting an operation push data past black and white. Now, this doesn’t make tonal sense, but it preserves the magnitude information for subsequent recovery in another operation.

2 Likes

Not quite. The (relative) quantization is kinda constant/identical across all sub-ranges when it comes to float representation.

One last thing to keep in mind that was hinted by others - while you’ll have no problems w/ dt as both are very well supported, some other tools might have different levels support when it comes to different features of TIFF (like floating point or deflate/zip compression) and PNG (typically Exif and XMP metadata support is spotty, maybe even color management is not ensured; not even all support 16 bits!).

Could be because the question was not specific enough and general information is readily available at an end of a web search.

What do you mean? Are you saying that there are as many floats in the interval [10^9, 10^9+1] than there are in [0, 1]?

Please note the relative.

1 Like

Yes, please elaborate. Otherwise the statement is not much useful as it is…

E.g. 32-bit float is comprised of a 24-bit base and 8-bit exponent. That means every sub-range (determined by the chosen exponent) has 2^24 values. Therefore the quantization step between those values is always the same, relative to the range.

As a consequence, you get this periodic graph like this one (16-bit float case; the 32-bit one would be even lower down and have higher frequency but less amplitude): Dolby Vision vs HDR10 Clarified – Display Daily