<div style="FONT-FAMILY: consolas">Hi experts!</div>
<div style="FONT-FAMILY: consolas"> </div>
<div style="FONT-FAMILY: consolas">I&#39;m trying to make a (lower quality) copy of a GeoTIFF file, and add overviews to that copy.</div>
<div style="FONT-FAMILY: consolas">It seems to work fine, BUT the resulting file has the colors messed up!</div>
<div style="FONT-FAMILY: consolas">With JPEG_QUALITY=30, the colors seem to be &quot;faded&quot;.</div>
<div style="FONT-FAMILY: consolas">With JPEG_QUALITY=90, they&#39;re more &quot;intense&quot; than the original.</div>
<div style="FONT-FAMILY: consolas">GDALINFO reports identical info for the input and output files (except for the overviews and quality)</div>
<div style="FONT-FAMILY: consolas"> </div>
<div style="FONT-FAMILY: consolas">The complete code (VisualBasic 2010, 32bits):</div>
<div style="FONT-FAMILY: consolas"> </div>
<div style="FONT-FAMILY: consolas">        <span style="COLOR: blue">Dim</span> gtiffdriver <span style="COLOR: blue">As</span> <span style="COLOR: #2b91af">Driver</span> = <span style="COLOR: #2b91af">Gdal</span>.GetDriverByName(<span style="COLOR: #a31515">&quot;GTIFF&quot;</span>)<br>
        <span style="COLOR: blue">Dim</span> viewfileoptions() <span style="COLOR: blue">As</span> <span style="COLOR: blue">String</span> = {<span style="COLOR: #a31515">&quot;TFW=YES&quot;</span>, <span style="COLOR: #a31515">&quot;TILED=YES&quot;</span>, <span style="COLOR: #a31515">&quot;BLOCKXSIZE=256&quot;</span>, <span style="COLOR: #a31515">&quot;BLOCKYSIZE=256&quot;</span>,<br>
                                            <span style="COLOR: #a31515">&quot;COMPRESS=JPEG&quot;</span>, <span style="COLOR: #a31515">&quot;JPEG_QUALITY=30&quot;</span>, <span style="COLOR: #a31515">&quot;PHOTOMETRIC=YCBCR&quot;</span>,<br>
                                            <span style="COLOR: #a31515">&quot;INTERLEAVE=PIXEL&quot;</span>,<br>                                            <span style="COLOR: #a31515">&quot;PROFILE=GeoTIFF&quot;</span>, <span style="COLOR: #a31515">&quot;BIGTIFF=IF_SAFER&quot;</span>}<br>
        <span style="COLOR: blue">Dim</span> inputdataset <span style="COLOR: blue">As</span> <span style="COLOR: #2b91af">Dataset</span> = <span style="COLOR: #2b91af">Gdal</span>.Open(inputfile, <span style="COLOR: #2b91af">Access</span>.GA_ReadOnly)<br>
        <span style="COLOR: blue">Dim</span> outputdataset <span style="COLOR: blue">As</span> <span style="COLOR: #2b91af">Dataset</span> = gtiffdriver.CreateCopy(outputfile, inputdataset, 1, viewfileoptions, <span style="COLOR: blue">Nothing</span>, <span style="COLOR: blue">Nothing</span>)<br>
        outputdataset.BuildOverviews(<span style="COLOR: #a31515">&quot;GAUSS&quot;</span>, overviews)<br>        outputdataset.FlushCache()<br>        outputdataset.Dispose()<br></div>
<div style="FONT-FAMILY: consolas">1 or 0 in the strict parameter to CreateCopy makes no difference.</div>
<div style="FONT-FAMILY: consolas">I&#39;ve tested both the 1.7.x version and the trunk (18dev).</div>
<div style="FONT-FAMILY: consolas">-</div>
<div style="FONT-FAMILY: consolas">Helge</div>