Recently, I was working on overview algorithms for Cloud Optimized GeoTIFFs (COGs). These extra smaller versions of a larger image are embedded in an image to help algorithms present a representation of the overall full resolution data much quicker. Downsampling data ahead of time can greatly optimize many processes that don’t need the full resolution data. The easiest task to think about that is benefited by overviews is visualization by humans. If you are zoomed out on a map, you would like to see an overview of what data is in that map. If, for example, you have 1 meter data, it’s not reasonable to fetch all of that 1 meter data to downsample the data into the few pixels that will be on your screen. Having a low resolution overview means that the computer only has to fetch a few pixels and it can get the user a nice view in a short time with little work. One of the key questions then is what algorithm should we use to produce these down-sampled extra images? GDAL’s COG driver lists the possible algorithms that it has available for overviews:
OVERVIEW_RESAMPLING=[NEAREST/AVERAGE/BILINEAR/CUBIC/CUBICSPLINE/LANCZOS/MODE/RMS]: (GDAL >= 3.2) Resampling method used for overview generation. For paletted images, NEAREST is used by default, otherwise it is CUBIC. This overrides, for overview generation, the value of RESAMPLING if it specified.
When should I use a particular resampling algorithm and why? Some of these are fairly obvious, but some I had no intuition for. If I have categorical data where an integer in each pixel has an assigned mean (e.g., 1 is grass land, 2 is forest, 3 is paved, 4 is bare ground, 5 is buildings, … 8 is water, etc.), then it makes no sense to use an algorithm that will interpolate neighboring pixels to produce a down sampled image. If we are trying to represent 9 pixels with 1 in a lower representation, we might have 6 pixels of grass (value 1) and 3 of water (value 8). If we use an average of the neighboring pixels, we have (1 * 6 + 8 * 3) / 9. = 3.33… Sticking with an integer representation, we might then round that to 3 and declare in the overview that the pixel is paved ground. That makes no sense. It might be better to use the nearest value or the most common value (mode). For elevation data, it might be best to use a cubic or cubic spline to interpolate the best representation. But maybe not. What properties are we trying to preserve in the overview and what algorithm will achieve that goal?
For each of the algorithms, it’s possible to apply it to a bunch of sample data and see what it does. That will give us concrete examples that we can look at, build intuition, and use algorithms to evaluate. So, what types of sample data should we use? And what if different people pick different data for the same evaluation? Two satellite images of even the same location on earth are likely to have different properties. The time of day may be different, the seasons change, land use may change, etc. And those differences might be even more dramatic if we pick different parts of the planet. If one person picked mountain forest and the other picked flat desert, then the results are likely super different.
We can have a whole library of sample images. Picking the images that should be in a catalog of key test images is challenging, but we can do it. These might include: constant images, impulse points, phase sweeps, a Siemens star, a USAF-1951 bar target, steps, slants/edges, ISO 12233 camera calibration targets, nodata zones, thin features, classes/categorical data, ramps, gradients, terraces, dipoles, peaks/valleys/saddles, satellite images, images of animals, various types of noise, text, logos, and more.
Can we create a single sample image that contains a range of data types that will cover a wide range of situations and give us carefully crafted data that can help bring out various aspects of algorithms? Why yes of course! But what should that key single image look like? I think it works well if we designate sub regions of the images (a.k.a., chips) that each contain a specific data type. That way, we only have to track one image, right? Well, we might need to have cases for integer input and floating point input images. We might need different precision (int8, uint8, … int64, uint64 and float8…float64, and a range of complex values). What about algorithms that operate on color, multispectral, or hyperspectral images? If we keep things simple, we can start with an int16 single band image and a float32 single band image.
I’ve wanted this kind of thing for a long time, but never had the time to put it together. But once I got access to Opus 5.5, I figured I’d let an LLM agent give it a go. I wrote up a prompt and had the agent work in an explicit Specification Driven Development (SDD) mode. The results are here:
https://github.com/schwehr/gdal-autotest2/tree/master/generate/example_grid
Take a look at the Product Requirements Document in PRD.md, PLAN.md, and TASKS.md to see how it progressed. It created a 6x14 grid for a total of 84 of chips. Here are the results. I’ve placed them over a red background so you can see where there are nodata values.

This is already down sampled to be on this screen, so I encourage people to play with the original. Here is GDAL’s summary of the int16 version:
gdalinfo resample_grid_int16.tif
Driver: GTiff/GeoTIFF
Files: resample_grid_int16.tif
Size is 6848, 15840
Coordinate System is:
PROJCRS["WGS 84 / Pseudo-Mercator",
[SNIP]
ID["EPSG",3857]]
Data axis to CRS axis mapping: 1,2
Origin = (0.000000000000000,0.000000000000000)
Pixel Size = (10.000000000000000,-10.000000000000000)
Metadata:
GDAL_VERSION=3.12.0dev-0eb3a1a5fa
RESAMPLE_GRID_DTYPE=int16
RESAMPLE_GRID_LAYOUT={"width": 6848, "height": 15840, "raw_width": 6844, "raw_height": 15836, "panel_px": 1024, "guard_px": 100, "margin_px": 100, "columns": 6, "rows": 14, "overview_factors": [2, 4, 8, 16, 32]}
RESAMPLE_GRID_SEED=559677208
RESAMPLE_GRID_VERSION=0.1.0
AREA_OR_POINT=Area
Image Structure Metadata:
COMPRESSION=ZSTD
INTERLEAVE=BAND
PREDICTOR=2
Corner Coordinates:
Upper Left ( 0.0000000, 0.0000000) ( 0d 0' 0.01"E, 0d 0' 0.01"N)
Lower Left ( 0.000, -158400.000) ( 0d 0' 0.01"E, 1d25'22.03"S)
Upper Right ( 68480.000, 0.000) ( 0d36'54.60"E, 0d 0' 0.01"N)
Lower Right ( 68480.000, -158400.000) ( 0d36'54.60"E, 1d25'22.03"S)
Center ( 34240.000, -79200.000) ( 0d18'27.30"E, 0d42'41.21"S)
Band 1 Block=512x512 Type=Int16, ColorInterp=Gray
NoData Value=-9999
It’s a GeoTIFF, so you can add it to a map in QGIS, Earth Engine, or other GIS tools. You can also use gdal_translate to place it anywhere you’d like on a globe. I used that idea combined with `gdal_translate` using the COG driver with the various overview algorithms to see how they work. The results have been super useful for me so far. Here is placing it on a map:

I encourage people to try out this image when learning new image processing / GIS algorithms. Or make your own calibration / test images that fit your needs. Everything in the sample image is LLM generated except that cat image (from SKLearn), the font for the text, and the (now old) Earth Engine logo. You are welcome to the machine generated images under the CC0 license.