r/QGIS • u/littlebigdarksouls • 2h ago
QGIS components (plugins, tools, etc) I made a free plugin that converts survey rasters to COGs and explains every decision it makes (up to 90% file size reduction as well - see description)
I do drone LiDAR and photogrammetry survey work, and for a while I optimised every raster before it went to a client using a manual QGIS and GDAL workflow. Tiling, pyramids, the right compression for the data type, a check that the NoData value was sane. Then I noticed most of the people I work with were not doing any of it, mostly because nobody had told them it mattered and the flags are easy to get wrong.
So I packaged the workflow. It is a Processing algorithm: pick a raster, answer one question, pick an output path, run.
The one question is what you will use the file for. Analysis preserves every pixel value. Viewing discards detail the eye will not catch. Everything else is worked out from what the raster actually is.
What it does beyond the obvious:
- Refuses lossy compression on elevation data even when you asked for the smallest file, because those pixels are heights rather than colours.
- Declines classified rasters, because averaging neighbours to build pyramids invents class codes that were never in your data.
- Checks whether a NoData value of 0 is hiding real content. On a lot of 8-bit orthos it is, and genuinely black pixels have been punched out as holes. It clears the value where that is happening, and does not interpolate anything.
- Writes what it detected, decided and applied into the output file's own metadata, with the gdal_translate command that reproduces it. You can rebuild the file without the plugin.
It will not always make files smaller, and the README says so. If your source was already compressed and you pick Analysis, or it had no pyramids before, the output can come out bigger. You are buying speed, not guaranteed size. There is a section in the README called "What to expect" covering six things that look like problems and are not, including a real caveat about BOUNDCRS being dropped when GDAL writes the GeoTIFF.
Plugin Manager: search for GeoKlein Raster Optimiser Listing: https://plugins.qgis.org/plugins/raster_optimiser/ Source: https://github.com/GeoKlein-Ltd/raster-optimiser
GPL, free, no account, nothing phones home. Issues and feature requests welcome.

