2014.12.21 20:12 "[Tiff] PNG in TIFF ?", by Ulf Zibis

2014.12.22 14:59 "Re: [Tiff] PNG in TIFF ?", by Tom Lane

That's not really PNG's compression method though. PNG does use deflate but there is a pixel-differencing filter in front of that; for lots of image types the filtering step is critical to the amount of compression you can get.

I tend to always use flate compression with the Predictor tag, in TIFF. I found that does indeed make a lot of difference (no pun intended).

I take it what you're saying is that the differencing filters in PNG are more advanced, and that there's more of them to (automatically or semi-automatically) choose from? I always thought the law of diminishing returns would likely apply, but I've never actually attempted to really measure. Would it be safe to say that the simple Predictor scheme in TIFF goes a long way, you think, or do I overestimate its capability when it comes to the bottom line compressed file size?

Setting Predictor would certainly be a lot better than nothing, but I doubt it would match PNG. IIRC, the only allowed predictor in TIFF is previous-pixel (horizontal differencing); PNG has about five options and allows per-scan-line choice of which to use.

Another thing to keep in mind is that Predictor is described as an optional extension in the TIFF spec. I don't know what compatibility hazards you face if you use it. (Of course, that caveat can be applied to depressingly many things in TIFF ...)

regards, tom lane