GDAL-RASTER-RESIZE(1)

โœจ GDAL-RASTER-RESIZE โœจ

okay bestie, sit down, hydrate, because today we're learning gdal-raster-resize โ€” it lives in the GDAL manual family (that's the GDAL in GDAL-RASTER-RESIZE(1), iykyk) and it does exactly one iconic thing: resize a raster dataset. no cap.

๐Ÿ’– psst โ€” this one was Added in version 3.11. so it's still kind of new-new, and we're obsessed.

๐ŸŒธ SYNOPSIS ๐ŸŒธ

Usage: gdal raster resize [OPTIONS] <INPUT> <OUTPUT>

Resize a raster dataset without changing the georeferenced extents.

Positional arguments:
  -i, --input <INPUT>                                  Input raster datasets [required] [not available in pipelines]
  -o, --output <OUTPUT>                                Output raster dataset [required] [not available in pipelines]

Common Options:
  -h, --help                                           Display help message and exit
  --json-usage                                         Display usage as JSON document and exit
  --config <KEY>=<VALUE>                               Configuration option [may be repeated]
  -q, --quiet                                          Quiet mode (no progress bar or warning message) [not available in pipelines]

Options:
  -f, --of, --format, --output-format <OUTPUT-FORMAT>  Output format ("GDALG" allowed) [not available in pipelines]
  --co, --creation-option <KEY>=<VALUE>                Creation option [may be repeated] [not available in pipelines]
  --overwrite                                          Whether overwriting existing output dataset is allowed [not available in pipelines]
                                                       Mutually exclusive with --append
  --append                                             Append as a subdataset to existing output [not available in pipelines]
                                                       Mutually exclusive with --overwrite
  --resolution <xres>,<yres>                           Target resolution (in destination CRS units)
                                                       Mutually exclusive with --size
  --size <width[%]>,<height[%]>                        Target size in pixels (or percentage if using '%' suffix) [required]
                                                       Mutually exclusive with --resolution
  -r, --resampling <RESAMPLING>                        Resampling method. RESAMPLING=nearest|bilinear|cubic|cubicspline|lanczos|average|mode (default: nearest)

Advanced Options:
  --if, --input-format <INPUT-FORMAT>                  Input formats [may be repeated] [not available in pipelines]
  --oo, --open-option <KEY>=<VALUE>                    Open options [may be repeated] [not available in pipelines]

๐Ÿ’… DESCRIPTION ๐Ÿ’…

gdal raster resize resizes a raster dataset without changing the georeferenced extents. that's the whole vibe. the extents stay put, the pixels get re-negotiated. ๐Ÿฆ‹

also!! this subcommand is available as a potential step of gdal raster pipeline โ€” so you can slot it into your little pipeline moment. slay.


๐ŸŒˆ GDALG OUTPUT (ON-THE-FLY / STREAMED DATASET) ๐ŸŒˆ

this program supports serializing the command line as a JSON file using the GDALG output format. the resulting file can then be opened as a raster dataset using the GDALG: GDAL Streamed Algorithm driver, and it applies the specified pipeline in an on-the-fly / streamed way. literally main character energy for build scripts. โœจ


๐ŸŽ€ PROGRAM-SPECIFIC OPTIONS ๐ŸŽ€

  • -r, --resampling <RESAMPLING> โ€” the resampling method to use. available methods are:
    • nearest: nearest neighbour resampling (default, fastest algorithm, worst interpolation quality). speed demon, quality hater.
    • bilinear: bilinear resampling.
    • cubic: cubic resampling.
    • cubicspline: cubic spline resampling.
    • lanczos: Lanczos windowed sinc resampling.
    • average: average resampling, computes the weighted average of all non-NODATA contributing pixels.
  • --resolution <xres>,<yres> โ€” sets the output file resolution (in target georeferenced units). Added in version 3.12. mutually exclusive with --size. ๐Ÿ’œ
  • --size <width[%]>,<height[%]> โ€” sets the output raster width and height, expressed in pixels, or percentage if using the % suffix. if the width or the height is set to 0, the other dimension will be guessed from the computed resolution. mutually exclusive with --resolution. ๐Ÿซถ

โญ STANDARD OPTIONS โญ

  • --append โ€” appends the input raster as a new subdataset to an existing output file. only works with drivers that support adding subdatasets, such as GTiff -- GeoTIFF File Format and GPKG -- GeoPackage raster. this also creates the output dataset if it does not exist yet. look at her, being flexible.
  • --co, --creation-option <NAME>=<VALUE> โ€” many formats have one or more optional creation options that can be used to control particulars about the file created. for instance, the GeoTIFF driver supports creation options to control compression, and whether the file should be tiled. may be repeated. the creation options available vary by format driver, and some simple formats have no creation options at all. a list of options supported for a format can be listed with the --formats command line option, but the documentation for the format is the definitive source of information on driver creation options. see Raster drivers format specific documentation for legal creation options for each format. (yes bestie, go read the docs, they ate.)
  • --if, --input-format <format> โ€” format/driver name to be attempted to open the input file(s). it is generally not necessary to specify it, but it can be used to skip automatic driver detection, when it fails to select the appropriate driver. this option can be repeated several times to specify several candidate drivers. note that it does not force those drivers to open the dataset. in particular, some drivers have requirements on file extensions. may be repeated.
  • --oo, --open-option <NAME>=<VALUE> โ€” dataset open option (format specific). may be repeated.
  • -f, --of, --format, --output-format <OUTPUT-FORMAT> โ€” which output raster format to use. allowed values may be given by gdal --formats | grep raster | grep rw | sort. ๐Ÿ’…
  • --overwrite โ€” allow the program to overwrite an existing target file or dataset. otherwise, by default, gdal errors out if the target file or dataset already exists. mutually exclusive with --append.
๐Ÿ’€ heads up: --append and --overwrite are mutually exclusive โ€” pick one, you cannot have both, that's the vibe check.

๐Ÿ”ฅ 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). so a lil warning is not a fail, bestie, breathe. ๐Ÿ˜ฎโ€๐Ÿ’จ


๐ŸŒธ EXAMPLES ๐ŸŒธ

Example 1: Resize a dataset to 1000 columns and 500 lines using cubic resampling

$ gdal raster resize --size=1000,500 -r cubic in.tif out.tif --overwrite

Example 2: Resize a dataset to half size using cubic resampling

$ gdal raster resize --size=50%,50% -r cubic in.tif out.tif --overwrite
๐ŸŽ€ not me about to --size=50%,50% my entire to-do list.

๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Even Rouault <even.rouault@spatialys.com> โ€” the icon, the legend, the moment.

1998-2026


and that's the whole page, babe! ๐ŸŒˆโœจ this masterpiece is brought to you by GDAL, dated Aug 18, 2026 โ€” go resize something gorgeous, and remember: nearest is fast, lanczos is pretty, and you're doing amazing. periodt. ๐Ÿ’…๐Ÿฆ‹๐Ÿงš๐Ÿ’œ

๐Ÿ“ฆ where this page comes from