[gdal-dev] CreateCopy/BuildOverviews produce strange colors

Helge Morkemo hmorkemo at gmail.com
Thu Aug 12 04:37:11 EDT 2010


Hi experts!

I'm trying to make a (lower quality) copy of a GeoTIFF file, and add
overviews to that copy.
It seems to work fine, BUT the resulting file has the colors messed up!
With JPEG_QUALITY=30, the colors seem to be "faded".
With JPEG_QUALITY=90, they're more "intense" than the original.
GDALINFO reports identical info for the input and output files (except for
the overviews and quality)

The complete code (VisualBasic 2010, 32bits):

        Dim gtiffdriver As Driver = Gdal.GetDriverByName("GTIFF")
        Dim viewfileoptions() As String = {"TFW=YES", "TILED=YES",
"BLOCKXSIZE=256", "BLOCKYSIZE=256",
                                            "COMPRESS=JPEG",
"JPEG_QUALITY=30", "PHOTOMETRIC=YCBCR",
                                            "INTERLEAVE=PIXEL",
                                            "PROFILE=GeoTIFF",
"BIGTIFF=IF_SAFER"}
        Dim inputdataset As Dataset = Gdal.Open(inputfile, Access
.GA_ReadOnly)
        Dim outputdataset As Dataset
 = gtiffdriver.CreateCopy(outputfile, inputdataset, 1, viewfileoptions,
Nothing, Nothing)
        outputdataset.BuildOverviews("GAUSS", overviews)
        outputdataset.FlushCache()
        outputdataset.Dispose()
1 or 0 in the strict parameter to CreateCopy makes no difference.
I've tested both the 1.7.x version and the trunk (18dev).
-
Helge
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20100812/38fe00b5/attachment.html


More information about the gdal-dev mailing list