GDALCOMPARE(1)

πŸ“¦
version 3.4.3 Β· 2 versions
, in epel 9

πŸ’… GDALCOMPARE πŸ’…

okay so bestie, buckle up β€” this is gdalcompare, a.k.a. the GDAL man page from the GDAL manual fam, and honestly? she's a vibe. she compares two images and tells you every single thing that's different about them. lowkey iconic.


✨ NAME ✨

gdalcompare β€” compare two images. that's it. that's the whole job. πŸŽ€


🌸 SYNOPSIS 🌸

gdalcompare.py [-sds] golden_file new_file

πŸ¦‹ DESCRIPTION πŸ¦‹

so the gdalcompare.py script takes two datasets that GDAL can handle and reports the differences between them. and not just, like, quietly β€” she reports differences to standard output and she returns the difference count in her exit value. double whammy. πŸ’–

what actually gets checked? image pixels, for one. and various metadata too. and on top of all that there's a byte-by-byte comparison happening, which counts as one difference. so like β€” heads up β€” if the only thing you actually care about is that the GDAL-visible data is identical, then a difference count of 1 (that's the binary difference right there) should be considered acceptable. no cap. ✨

  • -sds β€” if you pass this flag, the script will compare all the subdatasets that are part of the dataset. if you don't pass it, subdatasets are just ignored. simple as that. πŸ™ˆ
  • <golden_file> β€” the file that's considered correct, a.k.a. the golden file. she's the reference, she's the moment, she's the standard. πŸ‘‘
  • <new_file> β€” the file being compared against the golden file, a.k.a. the new file. she's the one under the microscope πŸ”₯
ngl one thing you should know: the gdalcompare.py script (like literally all the other scripts, fr fr) can also be called as a library straight from your python code:
from osgeo_utils import gdalcompare

the primary entry point is gdalcompare.compare(), which takes a golden gdal.Dataset and a new gdal.Dataset as arguments and returns a difference count β€” and yes, that's excluding the binary comparison, just so we're clear πŸ’…. and if you're doing the subdataset thing, the gdalcompare.compare_sds() entry point is right there for comparing subdatasets. 🫢


πŸ‘‘ AUTHOR πŸ‘‘

Frank Warmerdam <warmerdam@pobox.com> β€” the author herself. respect the icon. 🌈


1998-2026 β€” yeah, she's been serving for a minute. ⭐


and that's the tea, bestie πŸ“ β€” this page is from the GDAL manual, dated Jan 08, 2026, and it lives at GDALCOMPARE(1). go forth and diff. πŸ§šπŸ’…

πŸ“¦ where this page comes from