[gdal-dev] Compression artifacts

Even Rouault even.rouault at mines-paris.org
Thu Dec 27 05:41:34 PST 2012


Le jeudi 27 décembre 2012 14:37:49, Jan Hartmann a écrit :
> On 12/27/2012 02:27 PM, Even Rouault wrote:
> > The artifacts are due to the lossy characteristics of JPEG compression
> > that are particularly visible on borders between nodata pixel and valid
> > pixels. An option would be to use nearblack to create a .msk mask file :
> > 
> > nearblack -setmask -o big_with_mask.tif big.tif -of gtiff
> > 
> > (I'm not sure if your original image has black or white nodata areas. If
> > it is white, then add -white to the previous command line)
> > 
> > And then do the gdal_translate with big_with_mask.tif as input (you
> > should perhaps consider adding "-co TILED=YES" too), and then gdaladdo.
> > 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.
> > 
> > MapServer should be able to use the mask file as a transparency mask.
> 
> 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


More information about the gdal-dev mailing list