[gdal-dev] Problem with black edges to DOQQs using JPEG in Tiff compression
Brian Case
rush at winkey.org
Sun Feb 12 14:58:09 PST 2017
steve and all
after reading my reply I noticed a major error
"first, if your data is non lossy you need to nearblack -nb 0 -near 15"
this should read "nearblack -nb 0 -near 0"
Brian
On Sun, 2017-02-12 at 13:16 -0800, Brian Case wrote:
> Steve,
>
> first, if your data is non lossy you need to nearblack -nb 0 -near 15
>
> however your DOQQ's dont have a collar so there is no reason to
> nearblack
>
> gdalwarp -dstalpha will crate an alpha band to mask out the collar after
> gdalwarp rotates the image. no nead to nearblack the output of gdal
> warp.
>
> when using gdal_translate to create a tiff with a mask band, and you
> warped file has a alpha band, gdal_translate -b 1 -b 2 -b 3 -mask 4
> this will crate a mask band from the alpha band
>
> brian
>
> On Sat, 2017-02-11 at 18:18 -0500, Stephen Woodbridge wrote:
> > 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
> >
> > _______________________________________________
> > gdal-dev mailing list
> > gdal-dev at lists.osgeo.org
> > https://lists.osgeo.org/mailman/listinfo/gdal-dev
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
More information about the gdal-dev
mailing list