The IMAGINE IMG format can use a simple lossless form of
compression that can be referred to as Dynamic Range Run-Length Encoding (DR RLE). This combines two different forms of compression to give a quick and effective reduction of dataset size. This compression is most effective on thematic data, but can also be effective on
continuous data with low variance or low dynamic range.
V
Wi
×
Vii=1 n
∑
Wi
i=1 n
∑
---=
Dynamic Range refers to the span from the minimum pixel value to the maximum pixel value found in a dataset. The dynamic range of the data is often several times smaller than the range of the pixel type in which it is stored. This can be computed by taking the difference of the maximum (VMAX) and the minimum (VMIN) value (plus one):
RDynamic = VMAX – VMIN + 1. For example, 8 bit data with a minimum value of 1 and a maximum value of 254 would have a dynamic range of 254. 16 bit data with a minimum value of 1023 and a maximum value of 1278 would have a dynamic range of 256. If the dynamic range is less than the natural range of the data type then a smaller data type can used to store the data with a resulting savings in space. In the second case above the Dynamic Range of the data was 256 but the natural range of 16 bit data (two bytes) is 65536. In this case a single byte can be used to store the data by computing a compressed value
(VCOMPRESSED) by subtracting the minimum value (VMIN) from the pixel value (VPIXEL). The data can then be saved with one value per byte (instead of one value per two bytes). To recover the data the minimum is added to the compressed value: VPIXEL =
VCOMPRESSED +VMIN. This, of course, requires the minimum value (VMIN) to be saved along with the data.
Run-Length Encoding is a compression technique based on the observation that often there are sequential occurrences (runs) of pixel values in an image. In this case, space can often be saved by counting the number of repeats (NRUN) of a value (VRUN) that occur in succession, and then storing the count and only one occurrence of the value. For example, if the pixel value 0 occurred 100 times in a row then the value (VRUN) would be 0 and the count (NRUN) would be 100. If a single byte is then used to store each of the count and the value, then 2 bytes would be used instead of 100. Run-Length Encoded data is stored as a sequence of pairs that consist of the count and the value (NRUN, VRUN).
By first applying Dynamic Range compression and then Run-Length Encoding, a high degree of lossless compression can be obtained for many types of data. By operating on a block of data at a time the Dynamic Range compression can have a greater effect because the data within a block is often more similar in range than the data across the whole image. Note that it is possible to produce a greater amount of data when applying Dynamic Range Run-Length Encoding. Under these circumstances, the data will be stored as the original
uncompressed block.
The compressed data for each block is stored as follows:
ECW Compression
Enhanced Compressed Wavelet (ECW) format significantly reduces the size of image files with minimal deterioration in quality.Wavelet compression technology offers very high quality results at high compression rates. You can typically compress a color image to less than 5% of its original size (20:1 compression ratio) and compress a grayscale image to less than 10% of its original size (10:1 compression ratio).
This means that, at 20:1 compression, 10GB of color imagery
compresses down to 500MB, which is small enough to fit on to a single CD-ROM. You may actually achieve higher compression rates where your source image has a structure well suited to compression.
ECW compression is more efficient when it is used to compress large image files. The minimum size image that can be compressed by ECW method is 128 x 128 pixels.
Because the compressed imagery is composed of multi-resolution wavelet levels, you can experience fast roaming and zooming on the imagery, even on slower media such as CD-ROM.
Name Type Description
Repeated only once per block at the front of the data stream
Min EMIF_T_LONG This is the minimum value observed in the block of data.
Numsegments EMIF_T_LONG This is the number of runs in the block.
Dataoffset EMIF_T_LONG This is the number of bytes after the start of this data that the segment data starts at.
Numbitspervalue EMIF_T_UCHAR This is the number of bits used per data value. It will be either 1, 2, 4, 8, 16, or
Countnumbytes EMIF_T_UCHAR This is the number of bytes for the count. It has the value 1, 2, 3 or 4.
Data[1] EMIF_T_UCHAR Present for numbitspervalue=16 or 32 Data[2] EMIF_T_UCHAR Present for numbitspervalue=32 Data[3] EMIF_T_UCHAR Present for numbitspervalue=32
In addition to reducing storage requirements, you can also use free imagery plug-ins for GIS and office applications to read compressed imagery with a wide range of software applications.
Specify Quality Level rather than Output File Size
The concept of ECW and JPEG2000 format compression is that you are compressing to a specified quality level rather than a specified file size. Choose a level of quality that benefits your needs, and use the target compression ratio to compress images within that quality range.
The goal is visual similarity in quality levels between multiple files, not similar file size.
ECW Compression Ratios
When exporting to ECW images, you select a target compression ratio.
This is a target only, and the actual amount of compression will vary depending on the image qualities and amount of spatial variation.
Recommended values are 1 to 40 for color images and 1 to 25 for greyscale. Higher values give more file size compression, lower values give better image quality.
What is Target Compression Ratio
When compressing images there is a tradeoff between the degree of compression achieved and the quality of the resulting image when it is subsequently decoded. The highest rates of compression can only be achieved by discarding some less important data from the image, known as lossy decompression. The target compression ratio is an abstract figure representing your choice in this tradeoff. It approximates the likely ratio of input file size to output file size given certain
parameters for compression.
It is important to note that the target ratio makes no guarantees about the actual output size that will be achieved, because this is dependent on the nature of the input data. Images with certain features (for example, air photos showing large regions of a similar color like oceans or forests) are easier to compress than others (completely random images). However in typical cases the actual rate of compression obtained will be greater than the target rate.
Except when compressing very small files (less than 2MB in size), the actual compression ratio achieved is often significantly larger than the target compression ratio set by the user. The reason for this is as follows.
Preserve Image Quality
When you specify a Target Compression Ratio, the compression engine uses this value as a measure of how much information content to preserve in the image. If your image has areas that are conducive to compression (for example, desert areas or bodies of water), a greater rate of compression may be achieved while still keeping the desired information content and quality.
The compression engine uses multiple wavelet encoding techniques simultaneously, and adapts the best techniques depending on the area being compressed. It is important to understand that encoding
techniques are applied after image quantization and do not affect the quality, even though the compression ratio may be higher than that which was requested.