<HTML><BODY><div class="cl-1tajg3fxp7"><div>Hi all.<br><br><span lang="en"><span><span>It would be great to have RGB DEM support in GDAL.</span></span></span></div><div> </div><div><span lang="en"><span><span>Some considerations.</span></span></span></div><div><span lang="en"><span><span>1. It makes sense to add support not only for Mapbox Terrain RGB, but also for Mapzen Terrarium RGB [1][2] encoding. Mapbox and Maplibre support both encodings, the latter also supports custom encoding [3][4]. Therefore, support for custom encoding will also be useful.</span></span></span></div><div> </div><div>2. <span lang="en"><span><span>I don't quite understand why only PNG format is being discussed here. It is possible to encode a DEM into any raster RGB image format. Moreover, PNG isn't the most optimal of them [5].</span></span> <span><span>In my opinion, the WEBP format is preferable.</span></span> <span><span>For example, Maptiler uses it for Terrain RGB and Ocean RGB datasets [6].</span></span></span></div><div> </div><div><span lang="en"><span><span>3. Ideally, the output should be not just an encoded image, but tiles ready for use in Mapbox/Maplibre/etc., including in the form of data sets (MBTiles, PMTiles).</span></span></span></div><div> </div><div> </div><div>[1] <a href="https://www.mapzen.com/blog/terrain-tile-service/">https://www.mapzen.com/blog/terrain-tile-service/</a></div><div>[2] <a href="https://github.com/tilezen/joerd/blob/master/docs/formats.md#terrarium">https://github.com/tilezen/joerd/blob/master/docs/formats.md#terrarium</a></div><div>[3] <a href="https://docs.mapbox.com/style-spec/reference/sources/#raster-dem-encoding">https://docs.mapbox.com/style-spec/reference/sources/#raster-dem-encoding</a></div><div>[4] <a href="https://maplibre.org/maplibre-style-spec/sources/#encoding_1">https://maplibre.org/maplibre-style-spec/sources/#encoding_1</a></div><div>[5] <a href="https://medium.com/@frederic.rodrigo/optimization-of-rgb-dem-tiles-for-dynamic-hill-shading-with-mapbox-gl-or-maplibre-gl-55bef8eb3d86">https://medium.com/@frederic.rodrigo/optimization-of-rgb-dem-tiles-for-dynamic-hill-shading-with-mapbox-gl-or-maplibre-gl-55bef8eb3d86</a></div><div>[6] <a href="https://www.maptiler.com/on-prem-datasets/dataset/terrain-rgb/#0.22/0/0">https://www.maptiler.com/on-prem-datasets/dataset/terrain-rgb/</a></div><div> </div><div class="mail-quote-collapse"><blockquote style="border-left:1px solid #0857A6;margin:10px;padding:0 0 0 10px"><span>Tuesday, January 6, 2026 0:46 AM +03:00 from Lars Ahlzen via gdal-dev <<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>>:</span><br> <div><div id=""><div class="cl-gdo6dqvxv0"><div class="js-helper_mr_css_attr js-readmsg-msg_mr_css_attr"><div id="style_17676496140889361257_mr_css_attr"><div id="style_17676496140889361257_BODY_mr_css_attr">On 05/01/2026 19:47, rayg wrote:<br>> Strange encoding, -10000 meters isn't deep enough for the Marianas<br>> Trench. You could borrow another 10 km from the 1.6 million meters<br>> still available on the positive side.<br>><br>> Scaling by 0.1 also means a 10 cm vertical resolution., which is<br>> useless for some use cases. The 24 bits per pixel could be much better<br>> allocated.<br><br>I kind of agree with both points, but I guess the format is what it is.<br><br>I don't think it's supposed to be a general-purpose storage format. It's<br>encoding just enough data to do good enough real-time visualization of<br>elevation, like hillshading or hypsometric tints, client side.<br><br>Looks like at least rio-rgbify [1] allows setting a custom base value<br>and interval. That might be something we want to emulate as well,<br>perhaps as creation options (if a raster format driver) or command line<br>options (if part of gdaldem).<br><br>- Lars<br><br>[1] <a href="https://github.com/mapbox/rio-rgbify">https://github.com/mapbox/rio-rgbify</a><br><br>_______________________________________________<br>gdal-dev mailing list<br><a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br><a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a></div></div></div></div></div></div></blockquote></div><br><div>--<br>Andrey</div></div></BODY></HTML>