Home » Data Sources » Unsigned Integer vs Signed Integer for Raster Data

Unsigned Integer vs Signed Integer for Raster Data

Unsigned Integer vs Signed Integer

Unsigned Integers vs Signed Integers

In brief, an unsigned integer is always a non-negative value. But a signed integer can store negative values.

That is the main difference between unsigned and signed integers.

Today, let’s look at which GIS formats can store signed and unsigned integers.

And when should you use unsigned and signed integers?

Signed Integer vs Unsigned Rasters

If you have 8-bit rasters, this is the valid range for unsigned vs signed:

8-BIT UNSIGNED: 0 to 256
8-BIT SIGNED: -128 to 127

When you use an 8-bit unsigned raster, valid values are from 0 to 255. This means that an 8-bit raster can store 256 values in total.

The valid range for an 8-bit signed is -128 to 127. If you have values larger than 127 or less than -128 in the input, then you will need to use a 16-bit signed.

Radiometric resolution

Radiometric resolution is the amount of detail in each pixel expressed in units of bits. A wide range of values gives the ability for pixel values to discriminate very slight differences.

All things being equal, an 8-bit raster produces significantly greater detail than a 4-bit raster.

Some raster formats do not support signed images.

Bit Depth

Supported Formats

When you convert an image in ArcGIS (Data Management Tools > Raster > Raster Dataset > Copy Raster) or another program, specify the pixel depth and file type.

When exporting as a signed raster, make note of the formats that support it.

For example:

  • JPEG, JP2, BMP, GIF, and PNG do not support 8-bit signed, 16-bit signed, or beyond. This means that you cannot store negative values with these raster formats.
  • IMG, TIFF (GeoTIFF), GRID, JPEG, JP2, BMP, GIF, PNG, BIL/BIP/BSQ, and DAT raster formats can store negative values.

So keep in mind that IMG, TIFF, and GRID are some of the most versatile formats available today. This is because these formats can accept 8-bit unsigned, 8-bit signed, 16-bit unsigned, 16-bit signed, 32-bit signed, and 32-bit floating.

In Conclusion

Next time you’re selecting a raster output, carefully select whether or not it’s an unsigned integer or a signed integer.

Unsigned numbers are always non-negative numbers.

Signed numbers can store negative values.

Then, IMG, TIFF, and GRID are acceptable formats for 8-bit, 16-bit, and 32-bit signed integers.