[gdal-dev] LZW Compression on geotiffs
Rahkonen Jukka (Tike)
jukka.rahkonen at mmmtike.fi
Wed Oct 1 21:31:43 PDT 2014
Even Rouault wrote:
>
> 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.
Not a bad suggestion.
Original 424 MB
DEFLATE without predictor 380 MB
DEFLATE with -co predictor=2 280 MB
-Jukka Rahkonen-
More information about the gdal-dev
mailing list