[gdal-dev] Problem with black edges to DOQQs using JPEG in Tiff compression

Stephen Woodbridge woodbri at swoodbridge.com
Sat Feb 11 15:18:35 PST 2017


Hi All,

I need your wisdom. I'm downloading NAIP DOQQs in GTiff format and I 
have a processing chain something like the following:

gdalwarp -t_srs EPSG:4326 -dstalpha -r "bilinear -multi -co TILED=YES 
-dstnodata '0 0 0' srctiff tmpfile

nearblack -nb 15 -q tmpfile

gdal_translate -co TILED=YES -co JPEG_QUALITY=90 -co COMPRESS=JPEG -co 
PHOTOMETRIC=YCBCR -b 1 -b 2 -b 3 -mask auto --config 
GDAL_TIFF_INTERNAL_MASK YES  tmpfile, target

nearblack -nb 5 -q target

gdaladdo -clean -r bilinear  target 2 4 8 16 32 64 128 512

And create a tileindex for mapserver of all the tiffs

If I skip the gdal_translate (ie: JPEG compression) and the 2nd 
nearblack, the doqq tiles are perfect with no nearblack edges between 
the doqq tiles. But when a JPEG compress them, I get edges between the 
doqqs like this:

http://imaptools.com:8080/dl/doqq-issue.jpg

I've never used the JPEG in tiff compression and I'm very impressed by 
the amount of size reduction there and how good the image remains, but I 
have not been able to figure out the magic trick to clearing the edge 
artifacts.

Any help would be appreciated.

Thanks,
   -Steve

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



More information about the gdal-dev mailing list