ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Compression (Environment setting)

  • Usage notes
  • Dialog syntax
  • Scripting syntax

Tools that honor the Compression environment setting will set the compression type when storing output raster datasets.

The primary benefits of compressing data are that compressed data requires less storage space, and data display times will be quicker because there is less information to transmit.

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.

The amount of compression will depend on the data and compression quality. The more homogeneous the data, the higher the compression ratio. The lower the compression quality, the higher the compression ratio. Lossy compression normally results in higher compression ratios when compared to lossless compression.

Usage notes

  • When storing data in a geodatabase, compression occurs before storage in the geodatabase.
  • JPEG compression only works for unsigned 8-bit raster data and unsigned 12-bit data (stored as 16-bit data).
  • If JPEG, JPEG_YCbCr, or JPEG 2000 is selected, you can also set the compression quality to control how much loss the image will be subjected to by the compression algorithm. The values of the pixels of an image compressed with a higher compression quality will be closer to those of the original image. Valid value ranges of compression quality are from 1 to 100. The default compression quality is 75. If you don't explicitly set a value, the default will be used.
  • The default compression type is LZ77, and it works for all types of raster data.
  • The following table summarizes the valid compression types for each pixel depth:

    Valid compressions for each pixel depth

    CompressionPixel Depth (8 bit)Pixel Depth (16 bit)Additional information

    LZ77

    Yes

    Yes

    Any pixel depth

    JPEG

    Yes

    Only 12-bit data; stored as 16-bit data

    JPEG_YCbCr

    Yes

    No

    JPEG2000

    Yes

    Yes

    PackBits

    Yes

    No

    1-bit to 8-bit data

    LZW

    Yes

    Yes

    Any pixel depth

    RLE

    Yes

    Yes

    Any pixel depth

    CCITT_G3

    No

    No

    Only for 1-bit data

    CCITT_G4

    No

    No

    Only for 1-bit data

    CCITT_1D

    No

    No

    Only for 1-bit data

    Valid compressions for each pixel depth
  • This setting is used for tools that create raster datasets in ArcGIS. Refer to Raster storage matrix to see which raster storage formats can be controlled when using this setting.

Dialog syntax

  • Compression—Choose which compression method to use when storing your data.
    • LZ77—Lossless compression that preserves all raster cell values. This is the default.
    • JPEG—Lossy compression that uses the public JPEG compression algorithm. If you choose JPEG, you can also specify the compression quality. The valid compression quality value ranges are from 0 to 100, with 75 being the default. This compression can be used for JPEG files, TIFF files, and geodatabases.
    • JPEG2000—Uses wavelet technology so rasters appear lossless. If you choose JPEG2000, you can also specify the compression quality. The valid compression quality value ranges are from 0 to 100, with 75 being the default. This compression can be used for JPEG 2000 files and geodatabases.
    • PackBits—PackBits compression for TIFF files.
    • LZW—Lossless compression that preserves all raster cell values.
    • RLE—Run-length encoding for IMG files.
    • CCITT_G3—Lossless compression for 1-bit data.
    • CCITT_G4—Lossless compression for 1-bit data.
    • CCITT_1D—Lossless compression for 1-bit data.
    • JPEG_YCbCr—Lossless compression using the luma (Y) and chroma (Cb and Cr) color space components. If you choose JPEG_YCbCr, you can also specify the compression quality. The valid compression quality value ranges are from 0 to 100, with 75 being the default.
    • None—No compression will occur.
  • Compression quality (1-100)—When JPEG, JPEG_YCbCr, or JPEG2000 compression is chosen, the compression quality also needs to be specified. The valid compression quality value ranges are from 1 to 100, with 75 being the default.

Scripting syntax

arcpy.env.compression = "compression_type {value}"

ParametersExplanation

compression_type (Required)

  • LZ77—Lossless compression that preserves all raster cell values. This is the default.
  • JPEG—Lossy compression that uses the public JPEG compression algorithm. If you choose JPEG, you can also specify the compression quality value. This compression can be used for JPEG files, TIFF files, and geodatabases.

    The valid compression quality value ranges are from 0 to 100, with 75 being the default.

  • JPEG2000—Uses wavelet technology so rasters appear lossless. If you choose JPEG2000, you can also specify the compression quality value. This compression can be used for JPEG 2000 files and geodatabases.

    The valid compression quality value ranges are from 0 to 100, with 75 being the default.

  • PackBits—PackBits compression for TIFF files.
  • LZW—Lossless compression that preserves all raster cell values.
  • RLE—Run-length encoding for IMG files.
  • CCITT_G3—Lossless compression for 1-bit data.
  • CCITT_G4—Lossless compression for 1-bit data.
  • CCITT_1D—Lossless compression for 1-bit data.
  • JPEG_YCbCr—Lossless compression using the luma (Y) and chroma (Cb and Cr) color space components. If you choose JPEG_YCbCr, you can also specify the compression quality. The valid compression quality value ranges are from 0 to 100, with 75 being the default.
  • NONE—No compression will occur.
  • VALUE

value (Optional)

When JPEG or JPEG2000 compression is chosen, the compression quality also needs to be specified. The valid compression quality value ranges are from 1 to 100, with 75 being the default.

compression syntax
import arcpy

# Set the compression environment to LZ77.
arcpy.env.compression = "LZ77"

# Set the compression environment to JPEG with a quality of 80.
arcpy.env.compression = "JPEG 80"

Related Topics

  • An overview of raster storage settings
  • An overview of geoprocessing environments
  • Environment levels and hierarchy
  • Raster compression
  • Raster pyramids
  • Setting geoprocessing environments
Feedback on this topic?

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal