[gdal-dev] LZW Compression on geotiffs

Even Rouault even.rouault at spatialys.com
Wed Oct 1 16:13:20 PDT 2014


Le jeudi 02 octobre 2014 01:06:57, David Strip a écrit :
> On 10/1/2014 12:02 PM, Jukka Rahkonen wrote:
> 
> For comparison:
> Tiff as zipped    347 MB
> Tiff into png     263 MB
> If I have understood right both zip and png are using deflate algorithm so
> there might be some place for improving deflate compression in GDAL.
> 
>  I was curious how png could achieve such  better compression if it is
> using the same deflate algorithm. I wouldn't think different
> implementations would account for so much improvement. It turns out the
> png compression uses a "filtering" step ahead of compression. This is
> explained here. The filter is similar to a differential pulse code
> modulation, in which the pixel is represented as the difference from the
> pixels to the left, left upper diagonal, and above. This typically reduces
> the magnitude of the value to something close to zero, making the encoding
> more efficient.

True, a way to improve things might be to specify -co PREDICTOR=2. Should 
apply to both LZW and DEFLATE.
This is one of the filter that might be used by PNG, except that PNG has 
different filters, so it will eventually beat TIFF deflate.

> 
>  David

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list