#7152 closed defect (invalid)
Noise in nodata areas using gdal_translate with JPEG compression
Reported by: | mattiassp | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | GDAL_Raster | Version: | 2.2.1 |
Severity: | normal | Keywords: | JPEG NoData gdal_translate |
Cc: |
Description
An uncompressed GeoTIFF (attached) generated with FME 17.1.1.1 (17652) is treated with gdal_translate for JPEG compression using:
gdal_translate.exe -co COMPRESS=JPEG "6504_120.tif" "6504_120_COMPRESSED.tif"
This results in nodata cells close to cells with data being filled with low data values which seem to be simple averages of the neighboring cells. See the attached image for an example of the kind of artefacts created.
I'm using gdal_translate built for QGIS 2.18.13, version 2.2.1 in Windows 7.
Attachments (2)
Change History (5)
by , 6 years ago
Attachment: | gdal_translate_jpeg_compression.zip added |
---|
by , 6 years ago
Attachment: | Raster_artefacts.PNG added |
---|
Example of artefacts created in nodata areas close to cells with data when using gdal_translate with COMPRESS=JPEG
comment:1 by , 6 years ago
What is the desired output? You probably know that JPEG is a lossy compression method and it is not possible that all zeros remains as zeroes after compression. There is even a GDAL utility made for handling that http://www.gdal.org/nearblack.html. It is still possible that your artefacts are worse than they need to be.
comment:2 by , 6 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
As Jukka raised those artifacts are due to the JPEG compression/decompression. Nearblack is indeed the way to generate a mask to workaruond that
Uncompressed and compressed GeoTIFF images and Windows batch file with the gdal_translate command used to compress the image.