[gdal-dev] Compression artifacts

Even Rouault even.rouault at mines-paris.org
Thu Dec 27 06:36:31 PST 2012


Le jeudi 27 décembre 2012 15:35:25, Jan Hartmann a écrit :
> On 12/27/2012 03:11 PM, Even Rouault wrote:
> > Le jeudi 27 décembre 2012 15:11:23, Jan Hartmann a écrit :
> >> On 12/27/2012 02:41 PM, Even Rouault wrote:
> >>> I've just pushed a fix since building overviews with "--config
> >>> COMPRESS_OVERVIEW JPEG -- config PHOTOMETRIC_OVERVIEW
> >>> YCBCR" when there's a .msk didn't work.
> >>> 
> >>>> OK Even, thanks. This means that I should use gdal-svn?
> >>> 
> >>> Not necessarily. I think you can workaround the issue by manually
> >>> building the overview on the .msk file as a post-processing step :
> >>> 
> >>> gdaladdo -ro --config COMPRESS_OVERVIEW DEFLATE small.tif.msk 2 4 8 16
> >>> 32 64
> >> 
> >> Do you mean I should use DEFLATE instead of JPEG as compression for
> >> overviews for the time being? What is the difference in compression
> >> ratio?
> > 
> > Use DEFLATE only for the mask file (see small.tif.msk in the above
> > command line), as it is a lossless compression, which is needed for a
> > mask. JPEG is fine for the imagery itself
> 
> Sorry, I don't understand. Where does that small.tif.msk come from?
> Until now I had:
> - the original raster (big.tif)
> - the raster masked with nearblack (big_with_mask.tif)

There should be a big_with_mask.tif.msk generated at that step, alongside 
big_with_mask.tif

> - the compressed raster (gdal_translate -co...)

And gdal_translate should also generate a small.tif.msk, as the input had a 
.msk file.

> - the overviews built with gdaladdo
> 
> The mask is part of the raster file, isn't  it?


More information about the gdal-dev mailing list