GIS Tools

Language

Made withfor the GIS community

Raster Resampler

Resample raster with nearest neighbor or bilinear interpolation

Raster Tools

Drop GeoTIFF here

Load a GeoTIFF and click Resample

Resampling Methods

  • β€’ Fastest, no smoothing, good for categorical data
  • β€’ Linear interpolation, good balance of speed/quality
  • β€’ Smoother results, better for photographs
  • β€’ Best for downsampling, preserves overall values

What Is Raster Resampling?

Raster resampling is the process of computing pixel values for a new raster grid that has a different cell size, alignment or projection from the original. Whenever you change the spatial resolution of a raster β€” making it coarser or finer β€” or reproject it to a new CRS, the pixel centres of the new grid no longer line up with the pixel centres of the old grid, and you have to estimate new values from the old ones. The estimation method is the resampling algorithm.

The Raster Resampler on gis.tools loads a GeoTIFF, lets you specify a target cell size and resampling method, and writes a new GeoTIFF in the browser. People search for "resample raster", "raster resampling", "raster downsample", "upsample raster", "qgis resample raster", "gdalwarp resample" and "raster resolution change" because resampling is the workhorse of any multi-resolution workflow: aligning datasets, reducing file sizes, preparing data for visualization, harmonising mismatched grids and feeding fixed-resolution analyses.

The choice of resampling method matters enormously: nearest neighbour preserves categorical class codes but produces blocky output on continuous data; bilinear smooths continuous data but smears categorical edges; cubic convolution sharpens at the cost of overshoot. Picking the right method for the right data is one of the most common questions GIS analysts face.

How Raster Resampling Works

For each cell in the output grid, the algorithm projects the cell centre back into the input raster's coordinate system, then estimates the input value at that location using one of several interpolation strategies.

Nearest Neighbour

The output cell takes the value of the input cell whose centre is closest. No new values are introduced β€” every output cell value already existed in the input. This makes nearest neighbour the only correct choice for categorical data: a land-cover raster resampled with bilinear would produce nonsense intermediate codes (e.g. cell halfway between class 1 and class 7 becomes 4, which is a totally different class).

Bilinear Interpolation

The output value is a distance-weighted average of the four input cell centres surrounding the output cell. Smooth, fast, and the standard choice for continuous data when you do not need maximum sharpness. Bilinear is appropriate for elevation, NDVI, temperature, reflectance, distance fields and continuous floats.

Cubic Convolution

The output value is computed from a weighted average of the 16 nearest input cells using a cubic kernel. Sharper than bilinear, can produce ringing or overshoot artefacts (output values that exceed the input range), but produces visually crisp imagery. Standard for orthophoto resampling and cartographic output.

Cubic Spline

A smoother variant of cubic interpolation that uses a B-spline kernel. Produces less ringing than cubic convolution at the cost of more blur.

Lanczos

A higher-order kernel (typically 36 cells contributing) that gives the sharpest result for downsampling. Used in image processing and high-quality remote sensing pipelines.

Average and Mode

For aggressive downsampling, average computes the mean of all input cells covering one output cell β€” essential for accurate downsampling of continuous data β€” while mode takes the majority class for categorical data.

Min, Max, Q1, Q3, Median

Statistical resampling methods used for advanced workflows where you want to preserve extremes or distribution properties when aggregating fine-resolution data into coarse cells.

Key Parameters and Options

Target Cell Size

The desired output resolution in raster units. Larger than input = downsample (coarser); smaller than input = upsample (finer). Upsampling does not create new information; it interpolates between existing values.

Resampling Method

Pick the algorithm above based on your data type and goal. Nearest for categorical, bilinear/cubic for continuous, average/mode for downsampling, Lanczos for high-quality cartographic output.

Output Bounds

By default the output covers the same extent as the input. You can set custom bounds to crop or pad.

Output CRS

If you specify a different CRS, the tool reprojects and resamples in one combined operation, equivalent to gdalwarp -t_srs ... -r ....

Snap to Grid

Align the output grid to a reference origin so adjacent rasters share pixel boundaries. Critical when preparing inputs for raster algebra or zonal statistics.

Output Data Type

Preserve the input data type or cast to a smaller/larger type if you need different precision.

Practical Applications

Aligning Datasets for Raster Algebra

Two rasters with different cell sizes cannot be combined cell-by-cell. You resample the finer one to match the coarser, or both to a common reference grid, before running NDVI Calculator, differencing, or per-pixel arithmetic.

Preparing Data for Web Tile Serving

Web tile services require fixed pyramidal resolutions (typically a power-of-two zoom hierarchy in Web Mercator). Resampling produces the levels of the pyramid.

Downsampling for Performance

A 10980x10980 Sentinel-2 tile is heavy to display in a browser. Downsampling to 2745x2745 (a 4x reduction) preserves regional context while saving 16x memory. Use average resampling for continuous data and mode for categorical.

Upsampling for Display

A 30 m DEM looks blocky at large zoom levels. Upsampling with bilinear or cubic produces smoother visuals β€” though no new terrain detail is created.

Reprojecting to a New CRS

Reprojection is fundamentally a resample-to-a-rotated-grid operation. Going from WGS84 to UTM requires resampling.

Aggregating Fine-Resolution Data to Coarse Statistics Grids

Population modellers aggregate fine WorldPop rasters to coarse policy grids using sum or mean resampling.

Preparing Categorical Land Cover for Habitat Models

Wildlife biologists resample national land cover from 30 m to 100 m using mode resampling, preserving categorical classes while reducing the cell count.

Step-by-Step Workflow in gis.tools

  1. Open the Raster Resampler page on gis.tools.
  2. Drag a GeoTIFF into the page. The file is decoded with geotiff.js.
  3. The tool displays the input cell size, dimensions, CRS and data type.
  4. Set the target cell size (in raster units) and the resampling method.
  5. Optionally specify a different output CRS, output bounds or snap-to-grid origin.
  6. Click Resample. The tool builds the output grid and runs the chosen kernel.
  7. Preview the result alongside the input on the map.
  8. Export the resampled raster as GeoTIFF or COG.
  9. Pass the result into NDVI Calculator, Zonal Statistics or Raster Mosaic Preview for downstream work.

Worked Example: Downsampling a 1 m Lidar DTM to 5 m for Watershed Modelling

You have a 1 m bare-earth Lidar DTM covering a 10 km2 watershed in Vermont. The file is 10000x10000 Float32 (~400 MB in memory). Your watershed model requires 5 m cells. You drop the DTM into the Raster Resampler, set the target cell size to 5 m, choose average resampling (because elevation is continuous and you want to preserve the mean over each output cell), and click Resample. The tool produces a 2000x2000 grid in a few seconds. The output is 25x smaller in memory (16 MB) and aligns to a clean 5 m grid origin. You verify the result by probing a few cells and confirming the elevation matches the local mean of the input. You export the COG and feed it into the watershed model.

Common Pitfalls and Gotchas

  • Using bilinear or cubic resampling on a categorical raster produces meaningless intermediate codes. Always use nearest or mode for class data.
  • Upsampling does not create new information; the apparent detail comes from the interpolation kernel, not from the data.
  • Aggressive downsampling without proper aggregation (e.g. nearest sampling at 10x coarser) introduces aliasing artefacts. Use average or Lanczos for clean results.
  • Resampling between misaligned grids can shift features by up to half a cell β€” snap to a reference grid if precise alignment matters.
  • Reprojection plus resampling combines two error sources; do it in one combined step rather than reproject then resample.
  • Cubic and Lanczos can produce output values outside the input range (overshoot). Clamp the output if your downstream process assumes a fixed range.
  • Float-to-Byte casts during resampling require an explicit scaling step.
  • Resampling a multi-band raster band-by-band uses extra memory; the tool handles all bands in one pass.

Tips for Best Results

  • Use nearest neighbour for categorical rasters (land cover, soil class, classification masks).
  • Use bilinear for continuous data when speed matters and modest smoothing is acceptable.
  • Use cubic convolution for orthophotos and sharp visual output.
  • Use average for downsampling continuous data β€” it preserves the mean accurately.
  • Use mode for downsampling categorical data β€” it preserves the dominant class.
  • Snap output to a reference grid origin when preparing inputs for raster algebra or zonal stats.
  • Combine reprojection and resampling in a single step to minimise interpolation error.
  • For very fine upsampling (10x or more), Lanczos produces the cleanest results but at higher computational cost.

Comparison with Other GIS Approaches

GDAL's gdalwarp -tr 5 5 -r bilinear input.tif output.tif is the canonical command-line resampling. ArcGIS Spatial Analyst's Resample tool wraps the same operation. QGIS exposes both via the GDAL-based Warp (Reproject) processing algorithm. Python with rasterio uses rasterio.warp.reproject. The Raster Resampler on gis.tools mirrors all of these in a no-install browser environment with identical algorithms. The main trade-off is browser memory; for multi-gigabyte rasters use a server-side pipeline.

Performance Considerations

Resampling cost is O(n_out * k) where n_out is the output cell count and k is the kernel size (1 for nearest, 4 for bilinear, 16 for cubic, 36+ for Lanczos). A 4000x4000 input bilinear-resampled to 2000x2000 takes well under a second; the same input cubic-resampled at 4x upsampling takes a few seconds. Memory scales with the larger of input and output sizes.

Data Privacy and Browser-Based Processing

The input raster is read with the File API, decoded by geotiff.js, processed by a WebAssembly numerical kernel and exported via a download blob. Nothing is uploaded. No file metadata is logged. This is essential for proprietary survey rasters, classified terrain data and any workflow with strict data residency rules.

Related GIS Concepts

Aliasing: Visual artefacts that appear when a continuous signal is sampled at too low a frequency. Nearest-neighbour downsampling introduces aliasing; average or low-pass filtering avoids it.

Reprojection: Transforming a raster from one CRS to another. Always involves resampling because the output grid does not align with the input.

Pixel-is-Area vs Pixel-is-Point: Two interpretations of what a raster cell represents. The interpretation affects how resampling computes new values.

Pyramid / Overviews: Pre-computed lower-resolution versions of a raster used for fast display at small map scales. Built by repeated downsampling.

Snapping: Forcing the output grid origin to align with a reference, ensuring adjacent rasters share pixel boundaries.

Frequently Asked Questions

Which resampling method should I use for a DEM?

Bilinear for general-purpose continuous resampling, cubic for sharp visualisation, average for accurate downsampling.

What about land cover or classification rasters?

Always use nearest neighbour. Mode is appropriate for downsampling.

Can I upsample to a finer cell size?

Yes, but it does not add new information. The output looks smoother but contains no extra detail.

Does resampling change the file size?

Yes β€” output file size scales with the output cell count. Downsampling shrinks files dramatically.

Will the output align with my other rasters?

Only if you snap to a common grid origin. Use the snap-to-grid option to ensure pixel-perfect alignment.

Can I reproject and resample in one step?

Yes β€” set both a target cell size and a target CRS and the tool combines the operations.

Related Tools on gis.tools

100% client-side processing - your data stays private and never leaves your device