The primary benefit of compressing your data is to reduce the size of the file to help save disk space. An added benefit is greatly improved performance over a network, because you are transferring a reduced amount of the data being read from disk and transferred to the server or direct read application. However, since compressed data must be decompressed to draw to the screen, it can be slower than data that is not compressed and can increase CPU requirements on the server or application. Most wavelet-based decompression is more CPU heavy than JPEG, LZW, or LZ77. When using JPEG 2000 compression, the amount of time spent on decompression is often related to the compression ratio. The more highly compressed the raster, the longer it will take to decompress.
Compression can also be applied on image services when transmitting pixels from a server to client applications. This is transmission compression and it is independent of storage compression. Transmission compression can significantly improve performance by reducing band width requirements. (Transmission compression for a map cache is the same as storage compression.)
ArcGIS can store compressed data in the following formats: IMG, JPEG, JPEG 2000, TIFF, Esri Grid, or in a geodatabase. When storing data in the geodatabase, the blocks of data are compressed before they are stored.
Data compression can be lossy (JPEG and JPEG 2000) or lossless (LZ77, PackBits, CCITT). Lossless compression means that the values of cells in the raster dataset are not changed or lost. You should choose lossless or no compression if the pixel values of the raster dataset will be used for analysis or deriving other data products.
Raster compression types supported in ArcGIS
Compression | Lossy or lossless | Notes |
---|---|---|
LZ77 | Lossless | |
JPEG | Lossy | Can define a compression quality |
JPEG 2000 | Lossy or lossless | Can define a compression quality |
PackBits | Lossless | Applies to TIFF only |
LZW | Lossless | |
RLE | Lossless | |
CCITT GROUP 3 | Lossless | Applies to TIFF only |
CCITT GROUP 4 | Lossless | Applies to TIFF only |
CCITT (1D) | Lossless | Applies to TIFF only |
None | No data compression |
LZ77 (the default) is a lossless compression that preserves all raster cell values. It uses the same compression algorithm as the PNG image format and is similar to ZIP compression. Because lossless compression retains all the pixel values, it can only compress raster data at a low file-size ratio (such as 2:1 or 3:1, depending on the data). Lossy compression, on the other hand, can compress raster datasets at a much higher ratio (such as 20:1); however, lossy compression does not retain the exact values of each pixel. Lossy compression is suitable for GIS projects in which the raster dataset is simply a background image, but it is usually not suitable for raster analysis.
For JPEG and JPEG 2000 compression, the level of compression will depend on the data but can also be controlled by changing the compression quality; the compression quality value ranges from 1 to 100 for both JPEG and JPEG 2000. Choosing a higher value will result in less compression and a higher-quality image. Choosing a lower value will result in more compression but a lower-quality image. JPEG compression ratios can be as great as 10:1, and JPEG 2000 can be as great as 20:1. The more homogeneous the data, the higher the compression ratio. The lower the compression quality, the higher the compression ratio. The JPEG (JFIF) compression algorithm can only be used with unsigned 8-bit raster data (one or more bands) and it can be applied on the first 12 bits of 16-bit data. JPEG 2000 uses wavelet technology to compress rasters so they visually appear lossless, meaning that although the cell values do get manipulated, the differences between the original and the same raster with compression are not easily distinguishable.
When storing a raster with JPEG 2000 compression in a personal geodatabase or file on disk, you can save the raster dataset using a lossless compression if you set the compression quality value to 100. You cannot achieve a lossless compression using this method within a file geodatabase or enterprise geodatabase. For file geodatabases and enterprise geodatabases, use LZ77 instead.
Lossy compression should be chosen
- If the rasters are only background images and there will be no analysis on the raster data
- For faster data loading and retrieval
- If less storage space is needed, since the compression ratios can range from 1:1 to 20:1.
Lossless compression should be chosen
- If the raster datasets are to be used for deriving new data or visual analysis
- If using discrete data
- If you don't plan to retain the original data
- If your inputs are already lossy compressed
Geodatabase raster compression options for image analysis
Bit depth | No compression | LZ77 compression |
---|---|---|
1 bit | OK | Recommended |
8 bit | OK | OK |
16 bit | OK | OK |
32 bit | OK | OK |
64 bit | OK | Recommended |
Geodatabase raster compression options for general imagery
Bit depth | JPEG compression | JPEG 2000 compression |
---|---|---|
1 bit | No | No |
8 bit | Recommended | Recommended |
16 bit | OK (only first 12 bits) | Recommended |
32 bit | No | No |
64 bit | No | No |
In some cases, you can store raster data without compression; however, compression is generally recommended. If you are unsure of which to use, at least choose the default of LZ77 (lossless).