Last Updated: 28 Nov, 2026

LZW vs DEFLATE vs ZSTD: Which GeoTIFF Compression Is Best?

LZW vs DEFLATE vs ZSTD: Which GeoTIFF Compression Is Best?

If you work with raster data long enough, you eventually hit a storage wall. Uncompressed GeoTIFFs are massive, slow to transfer across networks, and expensive to host in cloud buckets. Fortunately, the GeoTIFF specification supports several lossless compression algorithms that shrink your files without altering a single pixel value.

When it comes to lossless raster optimization, three algorithms dominate modern GIS workflows: LZW, DEFLATE, and ZSTD. While they all achieve the same fundamental goal—reducing file size without data loss—their underlying mechanics, speed profiles, and software compatibility differ dramatically.

Here is a practical breakdown of how LZW, DEFLATE, and ZSTD stack up, along with clear guidelines on which one you should choose for your next project.

Why Lossless Compression Matters in GIS

Before comparing the algorithms, it helps to clarify why lossless compression is non-negotiable for analytical datasets. Unlike JPEG or WebP—which discard subtle visual details to achieve tiny file sizes—lossless compression preserves exact numerical values.

If you are working with Digital Elevation Models (DEMs), multispectral satellite bands, climate models, or land-cover classifications, modifying pixel values ruins downstream calculations. Lossless algorithms find mathematical patterns and redundancies in your data so the file can be reconstructed bit-for-bit upon reading.

1. LZW (Lempel–Ziv–Welch): The Universal Veteran

LZW has been the default workhorse of the geospatial industry for decades. Originally patented in the 1980s (though the patent expired long ago), it is built into virtually every TIFF reader ever written.

  • How it works: LZW builds a dynamic dictionary of recurring byte sequences as it reads your raster, replacing repeated patterns with shorter reference codes.
  • Pros: Unmatched compatibility. Whether you are opening a file in QGIS, ArcGIS Pro, older legacy desktop software, or specialized remote sensing tools, LZW will work out of the box. It also writes faster than DEFLATE at default settings.
  • Cons: It produces noticeably larger files than DEFLATE and ZSTD, especially on complex floating-point rasters. Its decompression (read) speed also lags behind modern alternatives.
  • Best for: Sharing data with external clients or partners when you have no control over what software version they use to open the file.

2. DEFLATE: The Storage Saver

DEFLATE is the exact same algorithm powering standard .zip archives and PNG images. It combines LZ77 dictionary coding with Huffman coding to squeeze extra efficiency out of repetitive data.

  • How it works: Instead of relying on a single dictionary lookup like LZW, DEFLATE searches for duplicate strings across a sliding window and encodes frequent symbols using shorter bit lengths.
  • Pros: Consistently delivers smaller file sizes than LZW—often 15% to 25% smaller depending on the data type. Like LZW, it enjoys near-universal support across modern GIS platforms and web-mapping servers.
  • Cons: Slow write speeds. Compressing a multi-gigabyte raster with DEFLATE can bottleneck your processing pipeline unless you explicitly enable multi-threading (NUM_THREADS=ALL_CPUS in GDAL).
  • Best for: Cold storage, archival datasets, and Cloud Optimized GeoTIFFs (COGs) where maximum compatibility and small file sizes matter more than initial write time.

3. ZSTD (Zstandard): The Modern Speed Demon

Developed by Facebook (Meta) and integrated into GDAL starting in version 2.3, ZSTD was designed from the ground up for modern multi-core CPUs. It has rapidly become the favorite among cloud-native geospatial engineers.

  • How it works: ZSTD pairs a large dictionary window with Finite State Entropy (FSE), a modern entropy coder that executes significantly faster than traditional Huffman coding.
  • Pros: Blistering read and write speeds. At default settings, ZSTD achieves compression ratios equal to or slightly better than DEFLATE while decompressing 3x to 5x faster. It also offers wide tunability (compression levels 1 through 22), letting you prioritize extreme speed or maximum shrinkage.
  • Cons: Compatibility gaps. While QGIS, GDAL, Rasterio, and modern ArcGIS Pro versions handle ZSTD effortlessly, older GIS software, legacy web browsers, and third-party enterprise tools may throw an “unsupported compression” error.
  • Best for: Internal data pipelines, high-traffic cloud servers, machine learning training datasets, and active analytical workflows where fast read times directly save compute costs.

Head-to-Head Comparison

FeatureLZWDEFLATEZSTD
Compression Ratio (Smaller = Better)GoodExcellentExcellent (Best overall)
Write Speed (Compression)FastSlowVery Fast (Tunable)
Read Speed (Decompression)ModerateModerate-FastBlistering Fast
Software CompatibilityUniversal (Legacy & Modern)Near-UniversalModern Tools Only (GDAL 2.3+)
Predictor SupportYes (PREDICTOR=2 / 3)Yes (PREDICTOR=2 / 3)Yes (PREDICTOR=2 / 3)

The Secret Weapon: Don’t Forget Predictors and Tiling

Choosing between LZW, DEFLATE, and ZSTD is only half the battle. If you run a compression algorithm without configuring predictors and tiling, you are leaving massive performance gains on the table.

1. Use the Right Predictor

Spatial data rarely changes randomly from one pixel to the next; adjacent pixels in an elevation model or satellite image usually have very similar values. A predictor tells GDAL to store the difference between neighboring pixels rather than the raw values, creating smaller numbers that compress far more efficiently.

  • PREDICTOR=2 (Horizontal Differencing): Always use this for integer data (8-bit, 16-bit, or 32-bit integers like RGB imagery or classified maps).
  • PREDICTOR=3 (Floating-Point Differencing): Always use this for Float32 or Float64 rasters (like DEMs, NDVI indices, or temperature grids). Without PREDICTOR=3, floating-point rasters barely compress at all.

2. Enable Internal Tiling (TILED=YES)

By default, uncompressed TIFFs store data in horizontal strips spanning the entire width of the image. If you zoom into a small corner of a stripped GeoTIFF, your software still has to decompress full-width strips across the file. Setting TILED=YES organizes the raster into small square blocks (typically 256×256 pixels), allowing GIS software and web maps to read only the exact tiles visible on screen.

Practical GDAL Commands You Can Copy

Ready to optimize your rasters? Here are the production-ready gdal_translate commands for the most common scenarios:

For maximum speed in modern pipelines (ZSTD + Floating Point DEM):

gdal_translate input_dem.tif output_zstd.tif \
  -co COMPRESS=ZSTD \
  -co PREDICTOR=3 \
  -co TILED=YES \
  -co NUM_THREADS=ALL_CPUS

For maximum compatibility and small size (DEFLATE + Integer Satellite Imagery):

gdal_translate input_imagery.tif output_deflate.tif \
  -co COMPRESS=DEFLATE \
  -co PREDICTOR=2 \
  -co TILED=YES \
  -co NUM_THREADS=ALL_CPUS

For legacy software delivery (LZW + Integer Data):

gdal_translate input_map.tif output_lzw.tif \
  -co COMPRESS=LZW \
  -co PREDICTOR=2 \
  -co TILED=YES

Final Verdict: Which One Should You Pick?

  • Choose ZSTD if you control the software environment. It gives you the smallest files alongside the fastest read and write speeds, making it the undisputed king for cloud pipelines, data science, and modern desktop GIS.
  • Choose DEFLATE if you are publishing public datasets, building Cloud Optimized GeoTIFFs (COGs) for broad consumption, or archiving data where every megabyte counts and wide compatibility is mandatory.
  • Choose LZW only when you are delivering files to clients stuck on older enterprise GIS systems that predate ZSTD support.

Frequently Asked Questions (FAQ)

Q1. Does GeoTIFF compression reduce the quality or accuracy of my raster data?

No, LZW, DEFLATE, and ZSTD are all 100% lossless algorithms, meaning every original pixel value is preserved identically upon decompression.

Q2. Which GeoTIFF compression produces the smallest file size?

ZSTD and DEFLATE produce nearly identical file sizes when paired with the proper predictor, both outperforming LZW by 15% to 25% on average.

Q3. Why is my compressed floating-point DEM still huge?

You likely omitted -co PREDICTOR=3, which rearranges floating-point bytes so lossless algorithms can actually find compressible patterns.

Q4. Can I use ZSTD compression inside a Cloud Optimized GeoTIFF (COG)?

Yes, ZSTD is officially supported in the COG specification and offers the fastest cloud streaming performance, though DEFLATE remains safer if older web clients need access.

Q5. How do I speed up slow DEFLATE compression in GDAL?

Add the creation option -co NUM_THREADS=ALL_CPUS to distribute the compression workload across all available processor cores.

See Also