[Gdal-dev] Gdalwarp color corruption

John Mitchell mitchelljj98 at gmail.com
Fri Jan 5 11:28:27 EST 2007


Does cubic spline resampling give the best quality?  I know that it is the
slowest.

Thanks,

John Mitchell

On 1/5/07, Frank Warmerdam <warmerdam at pobox.com> wrote:
>
> Craig Miller wrote:
> > I've been using gdalwarp to reproject USGS quads (single band geotif
> images
> > with color table) from UTM zone 10/11 to geographic (EPSG:4326).  If I
> use
> > nearest neighbor sampling (-rn) the color table gets translated
> correctly,
> > but if I use bilinear, cubic, or cubic spline resampling the color table
> is
> > corrupted.  For example, blue water turns brown.  As nearest neighbor
> > sampling doesn't always offer up the smoothest results I'm hoping to get
> > cubic spline resampling working.  Any suggestions on how to get this
> working
> > w/o corrupting my color table?
> >
> > I'm using gdal out of CVS from a couple of weeks ago.
> >
> > Gdalwarp -rcs -co "COMPRESS=LZW" -co "TILED=YES" -wo "INIT_DEST=NO_DATA"
> > -t_srs EPSG:4326 infile.tif ..\geo\outfile.tif
> >
> > I'd be happy to provide sample images, but they are a bit large so I
> didn't
> > want to send them to the list.
>
> Craig,
>
> The actual resampling algorithms don't (and can't really be expected) to
> operate in colormap color space.  Instead they just operate on the raw
> pixel values.  If you want to use a "non-ramp" color table with resampling
> types other than nearest neighbour you will really need to first convert
> your image to 24bit RGB.
>
> eg.
>
> pct2rgb.py infile.tif infile_rgb.tif
>
> Then operate on that with other resampling techniques.
>
> 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    | President OSGeo, http://osgeo.org
>
> _______________________________________________
> Gdal-dev mailing list
> Gdal-dev at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/gdal-dev
>



-- 
John J. Mitchell
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20070105/c0d2add0/attachment.html


More information about the Gdal-dev mailing list