<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>If you initialize empty overviews ( BuildOverviews("NONE", ... )
), then you can read the downscaled version of the original
geotiff and put that in the target overviews. Of course you'll pay
the price of decompression/recompression. By using directly the
libtiff API, you could save that</p>
<p>Even<br>
</p>
<div class="moz-cite-prefix">Le 30/07/2021 à 20:19, Javier Jimenez
Shaw a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:CADRrdKuUs6e2Z6TCPyw2XAw28PxTrrOzGX9m9j4ZPyO1jJHJDg@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div>Hi</div>
<div><br>
</div>
<div>I want to make a (power-of-two) downscaled version of a
geotiff with overviews efficiently with C++ (not from the
console).<br>
</div>
<div><br>
</div>
<div>Let's say I have a geotiff with overviews (external or
internal), and I want a copy of it, but at 50% of the size.
That is just removing the "base" of the pyramid, but keeping
all the other levels. Then voilà, there you have the geotiff
50% smaller, with the overviews already there, almost without
any computation. The same for 25% (and any power of 2).</div>
<div><br>
</div>
<div>However I do not figure out how to do it efficiently in
C++. If I understand correctly, CreateCopy is producing an
image with the same size. So to downscale I have to create a
new image, read downscaled (that will use the overviews) and
write. But later, I have to recreate the overviews on the new
image... that are already in the original image.</div>
<div><br>
</div>
<div>Is there any way to make it efficiently? (as we have the
data there)</div>
<div><br>
</div>
<div>Thanks.<br>
</div>
<div>
<div>
<div dir="ltr" class="gmail_signature"
data-smartmail="gmail_signature">.___ ._ ..._ .. . ._.
.___ .. __ . _. . __.. ... .... ._ .__<br>
Entre dos pensamientos racionales <br>
hay infinitos pensamientos irracionales.<br>
<br>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</body>
</html>