[gdal-dev] Impact of tile size on artifacts in JPEG-compressed Tiffs

jratike80 jukka.rahkonen at maanmittauslaitos.fi
Wed Nov 15 08:08:17 PST 2017


Jacob Adams wrote
> I'd like to check my understanding of the impact of the tile size on
> JPEG-compressed geotiffs. 
> 
> I've been getting dark bands 4 or 5 pixels wide on the bottom and right
> edges of the image when manually creating large image tiles from a
> collection of smaller tiles. I'm using the common aggressive compression
> settings for jpeg with a specified extent (in map units) as follows:
> gdal_merge.py -ps .25 .25 -ul_lr 1528148 3773703 1529109 3772785 -co
> compress=jpeg -co interleave=pixel -co photometric=ycbcr -co tiled=yes -o 
> <outfile>
>  
> <infiles>
> While subtle, they are distracting and are more visible when placed next
> to other imagery or when resampling. 
> 
> I've found two ways to get rid of them via trial and error: 
> 1) Don't use tiling.
> 2) Make sure your image size (in pixels) is a multiple of your tile size. 
> 
> I want to use tiling to speed up access time. If I adjust the extent to
> make the image size a multiple of some of the factors of the tile size,
> such as 128, 16, or 8 (for a default tile size of 256x256) the dark area
> is still there but shrinks to one or two pixels. This tells me it's not
> related to the MCU of the JPEG compression. 
> 
> Am I correct in saying that the image size should be a multiple of the
> tile size when using compress=jpeg and tiled=yes to avoid generating these
> darker bands on the bottom and right edges of the images?
> 
> Thanks,
> Jake Adams
> 
> _______________________________________________
> gdal-dev mailing list

> gdal-dev at .osgeo

> https://lists.osgeo.org/mailman/listinfo/gdal-dev

Hi,

I would also have a try by making first a virtual mosaic with gdalbuildvrt
and then running gdal_translate instead of using gdal_merge.py.

-Jukka Rahkonen-



--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html


More information about the gdal-dev mailing list