[Gdal-dev] assign nodata to existing tif?

Frank Warmerdam warmerdam at pobox.com
Fri Nov 25 17:08:34 EST 2005


On 11/25/05, Matt Wilkie <matt.wilkie at gov.yk.ca> wrote:
> No this is not cded. I'm mosaicking together shaded relief images (256
> colour gray scale arcinfo grids) using gdal_merge and then jpeg
> compressing the mosaick. When I do that I get edge resampling. Using
> -a_nodata has no effect.
>
>    gdal_merge -o no-comp.tif -n 255 {list of grids}
>    gdal_translate no-comp.tif jpeg.tif -co "compress=jpeg" -a_nodata 255
>
> To test I also tried translating a single source grid, with and without
> -a_nodata, and replicated the edge effect. Screen shot attached.

Matt,

JPEG format has no concept of nodata values, and has no
way to avoid including some pixels in the local compression
blocks.  If you want decent edges, I think JPEG is the
wrong format.  You might find that PNG compresses
well if the images look like the sample.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list