[ELGIS] Issue GDAL with JPEG-compressed TIFFS [SEC=UNCLASSIFIED]
Bruce Bannerman
B.Bannerman at bom.gov.au
Sun Feb 5 17:20:54 EST 2012
Peter,
We may want to look at the rationale of compressing a tiff via jpeg.
The reason that many people use the tiff format is because that want a loss-less data format.
When we introduce the jpeg compression, we introduce a 'lossy' compression algorithm that corrupts the source data.
If you're just after good compression and don't care about losing some of the integrity of the data for performance and visualisation reasons, I'd suggest just compressing the data to a format that uses wavelet compression, e.g. Ecw or perhaps jpeg2000. I personally find ecw to be very good for this purpose.
Bruce
On 3/02/12 10:23 PM, "Peter Hopfgartner" <peter.hopfgartner at r3-gis.com> wrote:
I'm doing quite some experiments with GDAL and image compression these days
I do have an issue with geotiff 1.3/gdal 1.8.1 on CentOS 6 with packages
from ELGIS. The story goes like this:
I create tiffs with
gdal_translate -of GTiff -co COMPRESS=JPEG -co JPEG_QUALITY=90
-co "TILED=YES" -co "BLOCKXSIZE=512" -co "BLOCKYSIZE=512" <infile>
<outfile>
and then add overviews with (I do have to add the overlays in distinct
steps, otherwise gdaladdo aborts with an error message).
gdaladdo --config COMPRESS_OVERVIEW JPEG --config INTERLEAVE_OVERVIEW
PIXEL --config JPEG_QUALITY_OVERVIEW 90 -r average <outfile> 3
gdaladdo --config COMPRESS_OVERVIEW JPEG --config INTERLEAVE_OVERVIEW
PIXEL --config JPEG_QUALITY_OVERVIEW 90 -r average <outfile> 9
gdaladdo --config COMPRESS_OVERVIEW JPEG --config INTERLEAVE_OVERVIEW
PIXEL --config JPEG_QUALITY_OVERVIEW 90 -r average <outfile> 27
gdaladdo --config COMPRESS_OVERVIEW JPEG --config INTERLEAVE_OVERVIEW
PIXEL --config JPEG_QUALITY_OVERVIEW 90 -r average <outfile> 81
(Trying with power-of-2-steps gives the same result. If I drop all
options from gdaladdo: same result).
I'll create a WMS service with MapServer 5.6.7 and do get a big red
square in the image. The square is "fixed" to the geografical position,
e.g. if I move the extend the square moves too. The square is situated
in the corner of the tiff file.
It appears only at some scales. If I change it very slightly, the square
remqins, if I change for more then approx 1%, it disappears.
I've put the two images at
http://www.r3-gis.com/gdal_issues/tiff_with_jpegcompression_and_overviews.jpeg
and
http://www.r3-gis.com/gdal_issues/tiff_with_nocompression_and_overviews.jpeg
.
The problem disappears if I do not run gdaladdo on the images or when I
do not use Jpeg compression:
gdal_translate -of GTiff -co "TILED=YES" -co "BLOCKXSIZE=512" -co
"BLOCKYSIZE=512" <origfile> <targetfile>
There are some hits for
http://www.google.com/search?client=ubuntu&channel=fs&q=mapserver+artefacts+in+raster+gdal&ie=utf-8&oe=utf-8,
but mostly related to older versions of GDAL and without resolution.
Thanks,
Peter
--
Peter Hopfgartner
R3 GIS Srl - GmbH
www.r3-gis.com
_______________________________________________
el mailing list
el at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/el
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/el/attachments/20120206/16c1d961/attachment.html
More information about the el
mailing list