Maybe this was a bit premature. <br><br>Unfortunately, the MEM dataset does not support the SetGCPs method, even though the documentation says it &#39;should&#39; .<br>(&quot;

Memory datasets should support for most kinds of auxilary information
including metadata, coordinate systems, georeferencing, GCPs,
color interpretation, nodata, color tables and all pixel data types.&quot;)<br><br>This works with the GTiff driver, but not with MEM:<br><br>import gdal<br>import gdal_array<br>import gdalconst<br>import numpy<br><br>rows = 10
<br>cols = 10<br><br>data = numpy.ones((rows,cols), numpy.int16)<br><br>driver = gdal.GetDriverByName(&#39;MEM&#39;)<br>image = driver.Create(&#39;dummy&#39;, rows, cols, 1, gdalconst.GDT_Int16)<br>gcps = []<br>gcps.append
(gdal.GCP(1,2,3,4))<br>image.SetGCPs(gcps, &#39;&#39;)<br><br><br>Ludwig<br><br><br><div><span class="gmail_quote">On 28/05/07, <b class="gmail_sendername">Ludwig M Brinckmann</b> &lt;<a href="mailto:ludwigbrinckmann@gmail.com">
ludwigbrinckmann@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Many thanks, <br><br>that seems to work beautifully. 
<br><br>So far I had been using tiff images as an intermediate container when creating files for which no Create() method is available, but the in memory MEM format&nbsp; of course is much superior, no fuss with temp files and no need to write to disk.
<br><br>Regards<br><span class="sg"><br>Ludwig</span><div><span class="e" id="q_112d2c06c1a43828_2"><br><br><br><div><span class="gmail_quote">On 28/05/07, <b class="gmail_sendername">Frank Warmerdam</b> &lt;<a href="mailto:warmerdam@pobox.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
warmerdam@pobox.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Ludwig M Brinckmann wrote:<br>&gt; I need to create paletted PNG files with transparency.<br>&gt;<br>&gt; I understand that I need to pass in a colour table with the alpha<br>&gt; channel set to 0.<br>&gt;<br>&gt; As I cannot create PNGs directly, I first create a Tiff with the
<br>&gt; colourtable and then do a CreateCopy.<br>&gt;<br>&gt; But when I then look at the PNG colour table, the transparency values<br>&gt; are gone (all set to 255). This is also true for the intermediate Tiff<br>&gt; file -- which is understandable as single band tiffs don&#39;t do
<br>&gt; transparency. I think when creating the tiff the colourtable is adjusted<br>&gt; so that it works for the Tiff, but then my transparencies are lost. (If<br>&gt; someone thinks this is a bug, I will turn my code into a short example).
<br>&gt;<br>&gt; I tried to alter the colour table after creating the tiff (or the<br>&gt; createCopy of the PNG), but this is not supported.<br>&gt;<br>&gt; What&#39;s the best way to do this -- maybe I just need a better
<br>&gt; intermediate format that does transparencies and can be created (which<br>&gt; one?)<br><br>Ludwig,<br><br>If you image isn&#39;t too large, and you are doing programatically (or<br>via scripts) you might want to use MEM format as your intermediate format.
<br>I believe it supports fully featured color tables, and no mess and fuss<br>with intermediate file cleanup.<br><br>&nbsp;&nbsp; <a href="http://www.gdal.org/frmt_mem.html" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.gdal.org/frmt_mem.html</a><br><br>Note, when creating MEM datasets and not needing to attach to an existing
<br>array in memory, just use any name for the dataset, such as &quot;tempimage&quot;.<br><br>Best regards,<br>--<br>---------------------------------------+--------------------------------------<br>I set the clouds in motion - turn up&nbsp;&nbsp; | Frank Warmerdam, 
<a href="mailto:warmerdam@pobox.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">warmerdam@pobox.com</a><br>light and sound - activate the windows | <a href="http://pobox.com/%7Ewarmerdam" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://pobox.com/~warmerdam</a><br>and watch the world go round - Rush&nbsp;&nbsp;&nbsp;&nbsp;| President OSGeo, 
<a href="http://osgeo.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://osgeo.org</a><br><br></blockquote></div><br>
</span></div></blockquote></div><br>