Have you looked at <a href="http://www.gdal.org/gdal_tutorial.html" target="_blank">http://www.gdal.org/gdal_tutorial.html</a>?<br><br>Attached is a Python code snippet that shows how to assign values to pixels in an image. To do what you're asking, you need to create the output raster, and then write out the values in your array into the correct pixel position.<br>
<br>I assume that you need to modify the values in the DEM, and not just simply convert the image from one format to another? <br><br>Roger<br>--<br><br><div class="gmail_quote">
2010/4/5 weixj2003ld <span dir="ltr"><<a href="mailto:weixj2003ld@163.com" target="_blank">weixj2003ld@163.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>Now,I can read data from a DEM file into an array,but I do not know how to use it to create a png file?</div>
<div>Thk u.</div>
<div>BTW,Some one tell me that freeimage can do it,but I do not know.</div>
<div> </div><br><br><span title="neteasefooter"></span><br>_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br></blockquote></div><br>