The difference between uncompressed size and physical size of a raster,

7339
11
02-02-2015 12:21 PM
JamalNUMAN
Legendary Contributor

The difference between uncompressed size and physical size of a raster,

 

I couldn’t figure out what might the uncompressed size indicate for.

 

For example, the raster below has 1.5 GB as physical size while the uncompressed size is 1.1 GB. How this might be explained.

Clip_74.jpg

 

Other example, the physical size is 13 MB and the uncompressed size is 111.1 GB

Clip_75.jpg

 

What might be the explanation for these two cases?

 

 

Thank you

 

Best

 

Jamal

----------------------------------------
Jamal Numan
Geomolg Geoportal for Spatial Information
Ramallah, West Bank, Palestine
11 Replies
DanPatterson_Retired
MVP Emeritus

Rounding representation...

JamalNUMAN
Legendary Contributor

Thanks Dan.

Does this mean that the uncompressed size is the rounding off for the physical size?

----------------------------------------
Jamal Numan
Geomolg Geoportal for Spatial Information
Ramallah, West Bank, Palestine
0 Kudos
DanPatterson_Retired
MVP Emeritus

dont' go comparing what you seen in windows with what you see in Arc* but in any event

Kilobytes to Gigabytes Conversion Calculator

JamalNUMAN
Legendary Contributor

Thanks Dan,

What I wanted to know here is to make sure that the uncompressed size of a raster refers somehow to its physical size but not to something else.

----------------------------------------
Jamal Numan
Geomolg Geoportal for Spatial Information
Ramallah, West Bank, Palestine
0 Kudos
PaulLohr
Occasional Contributor III

Hello Jamal,

For 8-bit per pixel data, uncompressed size can be found with this formula:

pixels X * pixels Y * number of bands = uncompressed bytes.

An 8-bit per pixel tiff file with no compression applied and only pixels in the file is a representation of uncompressed size of the image. In your screen captures above there is compression applied. So the size on disk is then different from the uncompressed size.

Of course there can be georefencing info in the file's header and maybe some other things. There's another reason for uncompressed size to not match the size on disk.

Page 23 of the ERDAS Field Guide shows the formula and an example. There is another part to this formula that helps with images that are not 8-bits per pixel. I almost always work with 8-bit per pixel image data so the formula above can be used most of the time.

http://www.gis.usu.edu/manuals/labbook/erdas/manuals/FieldGuide.pdf

JamalNUMAN
Legendary Contributor

Thank you very much Paul.

This is very valuable answer that shows how the physical size of an image is calculated.

Clip_105.jpg

It remains to find a mathematical equation that associates the uncompressed size with the physical size.

----------------------------------------
Jamal Numan
Geomolg Geoportal for Spatial Information
Ramallah, West Bank, Palestine
0 Kudos
KaleighKeley
New Contributor II

The raster object should have the same compression type, compression quality, pixel depth, number of bands, and tile size as the final raster object that it will represent. These raster properties affect storage size of a raster object within the database.

   The total raster dataset size to sample size ratio is calculated as -  total size of all rasters / sample raster size =     total size to sample size

Data Transfer Conversion Calculator

RedfredGarett
New Contributor

Thanks Kaleigh,

This is an excellent post. I’d love to see these tests repeated with ArcGIS 10.1 to see what the deltas are between 10.0 and 10.1 performance on the same hardware.

Thanks !!

Luke_Pinner
MVP Regular Contributor

Jamal NUMAN:

...

It remains to find a mathematical equation that associates the uncompressed size with the physical size.

There are many different types of raster compression, both lossy and lossless. You can't reliably calculate compressed file size from uncompressed size as it is very dependent on the values in the raster (and on the compression type). Consider two rasters, both with the same number of bands, bit depth, rows and columns. One is full of random values, the other contains only 1s. The first will compress poorly and the second will compress to a very small file size.

The following file sizes are for 1 band, 16bit, 512x512 rasters, one containing just 1s and the other with random values:

524.9Kb test_ones.tif

524.9Kb test_random.tif

13.9Kb   test_ones_compressed.tif

681.4Kb test_random_compressed.tif

The rasters were compressed with LZW compression. Note the compressed raster with random data is actually larger in file size than the uncompressed version.  This is an extreme case, but you will find that rasters with larger contiguous areas of the same value will compress better than rasters whose values vary. For example, a land use classification raster will compress much better than a satellite image band.