Converting a GeoTIFF to a Cloud Optimized GeoTIFF (COG) is one of the highest-impact, lowest-effort improvements you can make to a raster deliverable. The same image that takes ninety seconds to download before showing a single pixel becomes something a client can pan and zoom in their browser instantly. The conversion is a single command, but the options matter — compression, projection, and tiling scheme all affect how the file performs on the web. Here’s how to do it properly.
A COG is still a valid GeoTIFF — every GIS tool that reads GeoTIFF reads a COG. The optimisation is additive, so you lose nothing by converting.
Method 1 — GDAL (the standard)
GDAL is the canonical tool for raster operations, and since version 3.1 it ships a dedicated COG output driver that handles internal tiling and overview generation for you. No separate gdaladdo step needed.
The basic conversion
gdal_translate input.tif output_cog.tif \
-of COG \
-co COMPRESS=DEFLATE \
-co NUM_THREADS=ALL_CPUS
That produces a tiled, overview-equipped COG in the file’s original projection — fine for storage and GIS use.
The web-optimised conversion
If the COG will be displayed on a web map (Leaflet, MapLibre, Google Maps, or a hosting platform), add the web-mercator tiling scheme so the internal tiles line up with the standard slippy-map grid and the viewer doesn’t have to reproject each tile on the fly:
gdal_translate input.tif output_cog.tif \
-of COG \
-co COMPRESS=DEFLATE \
-co OVERVIEW_RESAMPLING=BILINEAR \
-co TILING_SCHEME=GoogleMapsCompatible \
-co NUM_THREADS=ALL_CPUS
TILING_SCHEME=GoogleMapsCompatible reprojects to EPSG:3857 and aligns the tile pyramid to the web-mercator grid — the single most useful flag for web delivery.
Choosing a compression
| Compression | Best for | Notes |
|---|---|---|
DEFLATE | Elevation models, single-band, lossless RGB | Lossless; pairs well with PREDICTOR=2 for smaller files |
LZW | General-purpose lossless | Lossless; widely compatible |
JPEG | RGB orthomosaics where some loss is acceptable | Much smaller; not for DEMs or analysis rasters |
ZSTD | Lossless with faster decode | Needs a recent GDAL build |
For continuous data like a DTM or DSM, add the horizontal predictor for a meaningful size reduction:
gdal_translate dem.tif dem_cog.tif -of COG \
-co COMPRESS=DEFLATE -co PREDICTOR=2
Large files (BigTIFF)
GeoTIFF has a 4 GB ceiling unless BigTIFF is enabled. The COG driver turns it on automatically when needed, but you can force it for files near the limit with -co BIGTIFF=YES.
Method 2 — rio-cogeo (Python)
If you work in Python or want stricter COG conformance, rio-cogeo (built on rasterio) is purpose-built for COGs:
pip install rio-cogeo
rio cogeo create input.tif output_cog.tif --cog-profile deflate
It applies sensible COG defaults and is the same tool you’ll use to validate the result (below).
Method 3 — QGIS (no command line)
If you’d rather not touch a terminal:
- Add your GeoTIFF to a QGIS project.
- Right-click the layer → Export → Save As…
- Set Format to GeoTIFF.
- Under Creation Options, choose the Cloud Optimized GeoTIFF profile (or switch the profile dropdown to COG).
- Optionally set the target CRS to EPSG:3857 for web use, then OK.
QGIS uses the same GDAL driver underneath, so the output is identical to the command-line result.
Exporting straight from photogrammetry software
Most photogrammetry tools export standard GeoTIFFs and you convert afterwards, but some now offer COG directly:
- Pix4D — recent versions expose a Cloud Optimized GeoTIFF option in the export settings.
- Agisoft Metashape — exports standard GeoTIFF; convert with GDAL afterwards.
- DroneDeploy / WebODM — export standard GeoTIFF; the GDAL step above is universal.
See what file formats drone surveys produce for where the orthomosaic sits among your other outputs.
Validate the result
Always confirm the file is actually a conformant COG — a tiled layout without overviews, or wrong block sizes, will quietly defeat the optimisation:
rio cogeo validate output_cog.tif
A valid COG reports that it’s tiled and lists its embedded overview levels. If validation fails, re-run the conversion with the -of COG driver (not a plain -of GTiff with manual creation options).
Test it in the browser
Once you have a COG, the quickest way to confirm it streams well is to open it in a browser viewer and zoom around — the overview should appear instantly and detail should fill in progressively. You can drop a COG straight into Swyvl’s free GeoTIFF viewer to check it, with nothing uploaded.
Skip the step entirely
If your end goal is to share the orthomosaic with a client online, you don’t have to convert anything yourself. Upload the raw GeoTIFF to Swyvl and the platform converts it to a web-mercator COG during processing and serves it as streamed map tiles behind a branded share link. The conversion above is worth knowing — and essential if you’re building your own pipeline — but for delivery, hosting handles it for you.