GDALADDO(1)
π GDALADDO π
okay so you found the gdaladdo page in the GDAL manual set β hi bestie, welcome, this one's a little gem β¨
πΈ NAME πΈ
gdaladdo β builds or rebuilds overview images. that's it, that's the whole vibe. it makes the lil zoomed-out previews for your rasters π
β¨ SYNOPSIS β¨
gdaladdo [-r {nearest,average,rms,bilinear,gauss,cubic,cubicspline,lanczos,average_magphase,mode}]
[-b band]* [-minsize val]
[-ro] [-clean] [-oo NAME=VALUE]* [--help-general] filename [levels]
π¦ DESCRIPTION π¦
so the gdaladdo utility can build or rebuild overview images for basically most supported file formats, and you get to pick from several downsampling algorithms. main character energy tbh π
the resampling algorithm menu π
-r {nearest(default),average,rms,gauss,cubic,cubicspline,lanczos,average_magphase,mode}β pick your resampling algorithm. and like, here's what each one actually does:nearestapplies a nearest neighbour (simple sampling) resampler.averagecomputes the average of all non-NODATA contributing pixels. starting with GDAL 3.1 this is a weighted average, taking into account properly the weight of source pixels not contributing fully to the target pixel. so it got smarter, slay.rmscomputes the root mean squared / quadratic mean of all non-NODATA contributing pixels (GDAL >= 3.3).bilinearapplies a bilinear convolution kernel.gaussapplies a Gaussian kernel before computing the overview, which can lead to better results than simple averaging in e.g. case of sharp edges with high contrast or noisy patterns. the advised level values should be2,4,8, ... so that a 3x3 resampling Gaussian kernel is selected. iykyk.cubicapplies a cubic convolution kernel.cubicsplineapplies a B-Spline convolution kernel.lanczosapplies a Lanczos windowed sinc convolution kernel.average_magphaseaverages complex data in mag/phase space.modeselects the value which appears most often of all the sampled points.
-b<band> β select an input band band for overview generation. band numbering starts from1. you can stack multiple-bswitches to select a whole set of input bands to generate overviews for π«Ά-roβ open the dataset in read-only mode, in order to generate external overview (for GeoTIFF especially).-cleanβ remove all overviews. bye bye π-oo NAME=VALUEβ dataset open option (format specific).-minsize<val> β maximum width or height of the smallest overview level. only taken into account if explicit levels are not specified. defaults to256.
new in version 2.3 β¨
- <filename> β the file to build overviews for (or whose overviews must be removed).
- <levels> β a list of integral overview levels to build. ignored with the
-cleanoption.
new in version 2.3: levels are no longer required to build overviews. in which case, appropriate overview power-of-two factors will be selected until the smallest overview is smaller than the value of the -minsize switch. so it just figures it out for you, king behavior π
gdaladdo will honour properly NODATA_VALUES tuples (special dataset metadata) so that only a given RGB triplet (in case of a RGB image) will be considered as the nodata value, and not each value of the triplet independently per band. important distinction, don't sleep on it π
selecting a level value like 2 causes an overview level that is 1/2 the resolution (in each dimension) of the base layer to be computed. and if the file already has existing overview levels at a level you selected, those levels will be recomputed and rewritten in place. no duplicates, we're not messy π
for internal GeoTIFF overviews (or external overviews in GeoTIFF format), note that -clean does not shrink the file. a later run of gdaladdo with overview levels will cause the file to be expanded, rather than reusing the space of the previously deleted overviews. so the space is just... gone, bestie π but listen β if you just want to change the resampling method on a file that already has overviews computed, you don't need to clean the existing overviews. save yourself the trouble fr fr.
some format drivers do not support overviews at all π. many format drivers store overviews in a secondary file with the extension .ovr that is actually in TIFF format. by default, the GeoTIFF driver stores overviews internally to the file operated on (if it is writable), unless the -ro flag is specified.
most drivers also support an alternate overview format using Erdas Imagine format. to trigger this use the USE_RRD =YES configuration option. this will place the overviews in an associated .aux file suitable for direct use with Imagine or ArcGIS as well as GDAL applications. (e.g. --config USE_RRD YES) π§
π EXTERNAL OVERVIEWS IN GEOTIFF FORMAT π
external overviews created in TIFF format may be compressed using the COMPRESS_OVERVIEW configuration option. all compression methods supported by the GeoTIFF driver are available here. (e.g. --config COMPRESS_OVERVIEW DEFLATE). the photometric interpretation can be set with the PHOTOMETRIC_OVERVIEW =RGB/YCBCR/... configuration option, and the interleaving with the INTERLEAVE_OVERVIEW =PIXEL/BAND configuration option. so many knobs, we love options π
- for JPEG compressed external and internal overviews, the JPEG quality can be set with
--config JPEG_QUALITY_OVERVIEW value. - for WEBP compressed external and internal overviews, the WEBP quality level can be set with
--config WEBP_LEVEL_OVERVIEW value. if not set, will default to75. - for LERC compressed external and internal overviews, the max error threshold can be set with
--config MAX_Z_ERROR_OVERVIEW value. if not set, will default to0(lossless). added in GDAL 3.4.1. - for DEFLATE or LERC_DEFLATE compressed external and internal overviews, the compression level can be set with
--config ZLEVEL_OVERVIEW value. if not set, will default to6. added in GDAL 3.4.1. - for ZSTD or LERC_ZSTD compressed external and internal overviews, the compression level can be set with
--config ZSTD_LEVEL_OVERVIEW value. if not set, will default to9. added in GDAL 3.4.1. - for LZW, ZSTD or DEFLATE compressed external overviews, the predictor value can be set with
--config PREDICTOR_OVERVIEW 1|2|3.
to produce the smallest possible JPEG-In-TIFF overviews, you should use:
--config COMPRESS_OVERVIEW JPEG --config PHOTOMETRIC_OVERVIEW YCBCR --config INTERLEAVE_OVERVIEW PIXEL
external overviews can be created in the BigTIFF format by using the BIGTIFF_OVERVIEW configuration option: --config BIGTIFF_OVERVIEW {IF_NEEDED|IF_SAFER|YES|NO}.
the default value is IF_SAFER starting with GDAL 2.3.0 (previously was IF_NEEDED). the behavior of this option is exactly the same as the BIGTIFF creation option documented in the GeoTIFF driver documentation. receipts β
YESforces BigTIFF.NOforces classic TIFF.IF_NEEDEDwill only create a BigTIFF if it is clearly needed (uncompressed, and overviews larger than 4GB).IF_SAFERwill create BigTIFF if the resulting file might exceed 4GB.
sparse GeoTIFF overview files (that is tiles which are omitted if all their pixels are at the nodata value, when there's one, or at 0 otherwise) can be obtained with --config SPARSE_OK_OVERVIEW ON. added in GDAL 3.4.1.
see the documentation of the raster.gtiff driver for further explanations on all those options π¦
π SETTING BLOCKSIZE IN GEOTIFF OVERVIEWS π
--config GDAL_TIFF_OVR_BLOCKSIZE <size>
example:
--config GDAL_TIFF_OVR_BLOCKSIZE 256
default value is 128, or starting with GDAL 3.1, if creating overviews on a tiled GeoTIFF file, the tile size of the full resolution image.
note: without this setting, the file can have the full resolution image with a blocksize different from overviews blocksize. (e.g. full resolution image at blocksize256, overviews at blocksize128). mismatched, lowkey chaotic, but valid π
π MULTITHREADING π
new in version 3.2 β¨
the GDAL_NUM_THREADS configuration option can be set to ALL_CPUS or a integer value to specify the number of threads to use for overview computation. go fast, bestie π₯
β C API β
functionality of this utility can be done from C with GDALBuildOverviews(). yes she has a C API too, versatile queen π
πΈ EXAMPLES πΈ
create overviews, embedded in the supplied TIFF file, with automatic computation of levels (GDAL 2.3 or later):
gdaladdo -r average abc.tif
create overviews, embedded in the supplied TIFF file:
gdaladdo -r average abc.tif 2 4 8 16
create an external compressed GeoTIFF overview file from the ERDAS .IMG file:
gdaladdo -ro --config COMPRESS_OVERVIEW DEFLATE erdas.img 2 4 8 16
create an external JPEG-compressed GeoTIFF overview file from a 3-band RGB dataset (if the dataset is a writable GeoTIFF, you also need to add the -ro option to force the generation of external overview):
gdaladdo --config COMPRESS_OVERVIEW JPEG --config PHOTOMETRIC_OVERVIEW YCBCR
--config INTERLEAVE_OVERVIEW PIXEL rgb_dataset.ext 2 4 8 16
create an Erdas Imagine format overviews for the indicated JPEG file:
gdaladdo --config USE_RRD YES airphoto.jpg 3 9 27 81
create overviews for a specific subdataset, like for example one of potentially many raster layers in a GeoPackage (the "filename" parameter must be driver prefix, filename and subdataset name, like e.g. shown by gdalinfo):
gdaladdo GPKG:file.gpkg:layer
π AUTHOR π
Frank Warmerdam <warmerdam@pobox.com>, Silke Reimer <silke@intevation.de> β legends, honestly π«Ά
π COPYRIGHT π
1998-2026
and that's the whole page, bestie π
this was GDAL's gdaladdo manual, dated Jan 08, 2026, straight from the GDAL source, version vibes and all π go build some overviews, you're gonna slay β¨ππ¦
π¦ where this page comes from
- epel 9: gdal3.4 3.4.3-5.el9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms