GDALADDO(1)
π GDALADDO(1) π β the gdaladdo page from the GDAL manual
π NAME π
gdaladdo β builds or rebuilds overview images. that's it, that's the whole job bestie β¨
π¦ SYNOPSIS π¦
Usage: gdaladdo [--help] [--long-usage] [--help-general]
[-r nearest|average|rms|gauss|bilinear|cubic|cubicspline|lanczos|average_magphase|mode]
[-ro] [--quiet] [-b <band>]... [-oo <NAME=VALUE>]...
[-minsize <val>]
[[-clean]|[--partial-refresh-from-source-timestamp]|
[--partial-refresh-from-projwin <ulx> <uly> <lrx> <lry>]|
[--partial-refresh-from-source-extent <filename1>[,<filenameN>]...]]
filename [<level>]...
β¨ DESCRIPTION β¨
okay so listen. the gdaladdo utility builds or rebuilds overview images for most supported file formats, using one of several downsampling algorithms. several. as in you get options. we love options π
TIP: the equivalent in the newgdalcommand line interface is: seegdal raster overview add,gdal raster overview deleteandgdal raster overview refresh.
π the flags, one by one, no skipping π
--helpβ show this help message and exit. short and sweet, we respect it π«Ά--help-generalβ gives you a brief usage message for the generic GDAL commandline options and exits.-q,--quietβ suppress progress messages and other non-error output. silence, but make it chic π-r{nearest|average|rms|gauss|bilinear|cubic|cubicspline|lanczos|average_magphase|mode} β select a resampling algorithm. the default isnearest, which is generally not appropriate if sub-pixel accuracy is desired. noted.
starting with GDAL 3.9, when refreshing existing TIFF overviews, the previously used method β as noted in the RESAMPLING metadata item of the overview β will be used if -r is not specified. it remembers, iconic behaviour honestly π§
the available methods are:
nearestβ applies a nearest neighbour (simple sampling) resampler.averageβ computes the average of all non-NODATA contributing pixels. starting with GDAL 3.1, this is a weighted average that takes into account properly the weight of source pixels not contributing fully to the target pixel.rmsβ computes the root mean squared / quadratic mean of all non-NODATA contributing pixels (GDAL >= 3.3).gaussβ applies a Gaussian kernel before computing the overview, which can lead to better results than simple averaging in e.g. cases 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.bilinearβ applies a bilinear convolution kernel.cubicβ applies a cubic convolution kernel.cubicsplineβ applies a B-Spline convolution kernel.lanczosβ applies a Lanczos windowed sinc convolution kernel.average_magphaseβ averages complex data in mag/phase space.modeβ selects 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. multiple-bswitches may be used to select a set of input bands to generate overviews for. stack 'em π-roβ open the dataset in read-only mode, in order to generate an external overview (for GeoTIFF especially).-cleanβ remove all overviews. yeet π§Ή-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. so smol π--partial-refresh-from-source-timestampβ added in version 3.8.
this option performs a partial refresh of existing overviews, when <filename> is a VRT file with an external overview. it checks the modification timestamp of all the sources of the VRT and regenerates the overview for the areas corresponding to sources whose timestamp is more recent than the external overview of the VRT. by default all existing overview levels will be refreshed, unless explicit levels are specified. see Example 7. β¨
--partial-refresh-from-projwin<ulx> <uly> <lrx> <lry> β added in version 3.8.
this option performs a partial refresh of existing overviews, in the region of interest specified by georeference coordinates, where <ulx> is the X value of the upper left corner, <uly> is the Y value of the upper left corner, <lrx> is the X value of the lower right corner and <lry> is the Y value of the lower right corner. by default all existing overview levels will be refreshed, unless explicit levels are specified. π―
--partial-refresh-from-source-extent<filename1>[,<filenameN>]... β added in version 3.8.
this option performs a partial refresh of existing overviews, in the region of interest specified by one or several filenames (names separated by comma). note that the filenames are only used to determine the regions of interest to refresh. the reference source pixels are the one of the main dataset. by default all existing overview levels will be refreshed, unless explicit levels are specified. see Example 8. π«Ά
<filename>β the file to build overviews for (or whose overviews must be removed). the main character of the operation, lowkey π<levels>β a list of integral overview levels to build. ignored with the-cleanoption. bye levels, we don't need you here π«- 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
-minsizeswitch. - starting with GDAL 3.9, if there are already existing overviews, the corresponding levels will be used to refresh them if no explicit levels are specified.
- 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
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. teamwork fr fr π€
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. if the file has existing overview levels at a level selected, those levels will be recomputed and rewritten in place. no mess, just rewrite β¨
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. 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. good news honestly π
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. tiny little detail, huge consequences π
most drivers also support an alternate overview format using Erdas Imagine format. to trigger this use the USE_RRD=YES configuration option (Example 5). 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 β¨
okay bestie, so if you're making external overviews in TIFF format, you can compress them with the COMPRESS_OVERVIEW configuration option. literally every compression method that the GeoTIFF driver supports is available here β like --config COMPRESS_OVERVIEW DEFLATE. and you can set the photometric interpretation with PHOTOMETRIC_OVERVIEW =RGB/YCBCR/... and the interleaving with INTERLEAVE_OVERVIEW =PIXEL/BAND. slay.
since GDAL 3.6, COMPRESS_OVERVIEW and INTERLEAVE_OVERVIEW are honoured when creating internal overviews of TIFF files. periodt.
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, it defaults to 75.
for WEBP compressed external and internal overviews, the WEBP lossless/lossy switch can be set with --config WEBP_LOSSLESS_OVERVIEW value. if not set, it defaults to NO (lossy). added in GDAL 3.6.0.
for LERC compressed external and internal overviews, the max error threshold can be set with --config MAX_Z_ERROR_OVERVIEW value. if not set, it defaults to 0 (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, it defaults to 6. 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, it defaults to 9. added in GDAL 3.4.1.
for JPEG-XL compressed external and internal overviews, these settings can be set since GDAL 3.9.0:
- whether compression should be lossless with
--config JXL_LOSSLESS_OVERVIEW YES|NO. default isYES. - level of effort with
--config JXL_EFFORT_OVERVIEW value, with value between1(fast)and9(flow). default is5. - distance level for lossy compression with
--config JXL_DISTANCE_OVERVIEW value, with value:0=mathematically lossless,1.0=visually lossless, usual range[0.5,3]. default is1.0. ignored ifJXL_LOSSLESS_OVERVIEWisYES. - distance level for lossy compression of alpha channel with
--config JXL_ALPHA_DISTANCE_OVERVIEW value, with value:0=mathematically lossless,1.0=visually lossless, usual range[0.5,3]. default is the same value asJXL_DISTANCE_OVERVIEW. ignored ifJXL_LOSSLESS_OVERVIEWisYES.
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. the behavior of this option is exactly the same as the BIGTIFF creation option documented in the GeoTIFF driver documentation.
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 GTiff -- GeoTIFF File Format 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 blocksize 256, overviews at blocksize 128)
πΈ NODATA / SOURCE VALIDITY MASK HANDLING DURING RESAMPLING πΈ
invalid values in source pixels, either identified through a nodata value metadata set on the source band, a mask band, an alpha band, will not be used during resampling. no cap.
the details of how it's taken into account depend on the resampling kernel:
- for nearest resampling, for each target pixel, one of the potential contributing source pixels is selected (in an implementation specific way). its value is used as it, be it valid or invalid.
- for bilinear, cubic, cubicspline and lanczos, for each target pixel, the weights of contributing source pixels is set to zero to ignore them when they are masked. there's an extra specificity for cubic and lanczos: given that some of the weights in the kernel are negative, such strategy could lead to strong overshoot/undershoot when there is an alternance of valid and invalid pixels. consequently, if any of the horizontal or vertical direction, if the maximum number of valid source pixels in each dimension is less than the radius of the resampling kernel, the target pixel is considered as nodata.
- for the other resampling methods, source pixels contributing to the target pixel are ignored if masked. only the valid ones are taken into account. if there are none, the target pixel is considered as nodata.
π§΅ MULTITHREADING π§΅
added in version 3.2.
the GDAL_NUM_THREADS configuration option can be set to ALL_CPUS or an integer value to specify the number of threads to use for overview computation. go off, multithreading. π
π― RETURN STATUS CODE π―
the program returns status code 0 in case of success, and non-zero in case of error (non-blocking errors emitted as warnings are considered as a successful execution).
π οΈ C API π οΈ
functionality of this utility can be done from C with GDALBuildOverviews().
π EXAMPLES π
Example 1: Create overviews, embedded in the supplied TIFF file, with automatic computation of levels
gdaladdo -r average abc.tif
Example 2: Create overviews, embedded in the supplied TIFF file
gdaladdo -r average abc.tif 2 4 8 16
Example 3: Create an external compressed GeoTIFF overview file from the ERDAS .IMG file
gdaladdo -ro --config COMPRESS_OVERVIEW=YES erdas.img 2 4 8 16
Example 4: 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
Example 5: Create Erdas Imagine format overviews for the indicated JPEG file
gdaladdo --config USE_RRD=YES airphoto.jpg 3 9 27 81
Example 6: Create overviews for a specific subdataset
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
Example 7: Refresh overviews of a VRT file
this is needed when for sources have been modified after the .vrt.ovr generation:
gdalbuildvrt my.vrt tile1.tif tile2.tif # create VRT
gdaladdo -r cubic my.vrt # initial overview generation
touch tile1.tif # simulate update of one of the source tiles
gdaladdo --partial-refresh-from-source-timestamp -r cubic my.vrt # refresh overviews
Example 8: Refresh overviews of a TIFF file
gdalwarp -overwrite tile1.tif tile2.tif mosaic.tif # create mosaic
gdaladdo -r cubic mosaic.tif # initial overview generation
touch tile1.tif # simulate update of one of the source tiles
gdalwarp tile1.tif mosaic.tif # update mosaic
gdaladdo --partial-refresh-from-source-extent tile1.tif -r cubic mosaic.tif # refresh overviews
π AUTHOR π
Frank Warmerdam <warmerdam@pobox.com>, Silke Reimer <silke@intevation.de>
π COPYRIGHT π
1998-2026
that's the whole vibe, bestie π this was GDALADDO(1), dated Aug 18, 2026 β go make some iconic overviews, you absolute legend. π«Άβ¨
π¦ where this page comes from
- alpine 3.24: gdal-doc 3.13.3-r0 Β· MIT
- arch rolling: gdal 3.13.3-6 Β· MIT
- ubuntu stonking: gdal-bin 3.13.3+dfsg-1ubuntu4 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms