Unsigned Integers vs Signed Integers
In brief, an unsigned integer is always non-negative numbers.
But a signed integer can store negative values.
That is the main difference between unsigned and signed integers.
Today, let’s look at which file formats can store signed and unsigned integers.
And when should you use unsigned and signed integers?
Signed Integer vs Unsigned Rasters
If you have for 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 a 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 16-bit signed.
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.
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.
- JPEG, JP2, BMP, GIF and PNG do not support 8-bit signed, 16-bit signed or beyond. This means that you won’t be able to 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.
- IMG, TIFF an GRID are the most versatile formats. These formats accept 8-bit unsigned, 8-bit signed, 16-bit unsigned, 16-bit signed, 32-bit signed and 32-bit floating.
Next time you’re selecting a raster output, carefully select whether or not it’s an unsigned integer or 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.