You are here: Appendix A - Technical Notes > Metadata Tags

## Metadata Tags

Encoded within each MrSID (and JPEG 2000) file is a set of metadata tags, used to convey additional information about the image. These tags are similar to TIFF tags, although the actual encoding mechanism is different. The mrsidinfo tool can be used to dump the metadata for an image.

The standard metadata tags used by all MrSID images, referred to as the "classical" tags, are listed below. Other than the "start" and "end" tags, the tags may appear in any order.

For mosaicked images, the metadata encoded with the image generally corresponds to the first image in the mosaic. The filename metadata tag contains a comma-separated list of the input files. The metadata refers to the image as presented to the encoder; this means that any filter or transforms operations will be correctly accounted for.

The metadata is supplemental information only. Some of this metadata is also contained in the LTIImage class; in general, querying the LTIImage class is preferred to evaluating the metadata, for example for information such as geographic position, background color, etc.

###### General Tags

The tags in the table below apply to MrSID encoding.

General Metadata Tags
Tag | Description | Notes
--- | --- | ---
IMAGE::BITS_PER_SAMPLE | Number of bits per sample (uint16) |
IMAGE::COLOR_SCHEME | Colorspace of image (uint32) | Values: 0 for RGB, 3 for grayscale, 2 for CMYK, 10 for multispectral
IMAGE::DATA_TYPE | Datatype of samples in image (uint32) | Values: 0 for unsigned 8-bit int, 1 for 32-bit float, 2 for unsigned 16-bit int
IMAGE::DEFAULT_DATA_VALUE | Sample values for background pixel | Stored as an array of values, one for each band, in order. The values are stored in the datatype of the samples NOTE: With older images containing uint8 data, the tag ``IMAGE::NO_DATA_VALUE`` may be used
IMAGE::DYNAMIC_RANGE_WINDOW | Custom contrast setting (double) | Represents the size of the range of the data. This tag can have per-band values for MG4 images
IMAGE::DYNAMIC_RANGE_LEVEL | Custom brightness setting (double) | Represents the midpoint of the range of the data. This tag can have per-band values for MG4 images
IMAGE::ENCODING_APPLICATION | Name and version of encoding application | Required tag
IMAGE::ENCODING_COMMENT | Context of encoding operation |
IMAGE::EOM | End of metadata |
IMAGE::FORMAT | Text representation of the format | Examples: "MrSID/MG4", "JPEG 2000"
IMAGE::HEIGHT | Height of the image, in pixels (uint32) |
IMAGE::INPUT_FILE_SIZE | Size of the input image or mosaic in bytes (double) |
IMAGE::INPUT_FORMAT | Name of input image type (string) |
IMAGE::INPUT_LUT | Color lookup table | Stored as an array of 256*3 values, one value for each band (R,G,B) for each of the 256 entries in the table
IMAGE::INPUT_NAME | Filename of the input image (string) |
IMAGE::LTI_ESDK_VERSION | The LizardTech SDK version number |
IMAGE::MODIFICATIONS | Changes to input pixel data | See list following this table for values.
IMAGE::NO_DATA_VALUE | Sample values for background pixel | Used only by older MrSID images; see IMAGE::DEFAULT_DATA_VALUE
IMAGE::QUANTIZATION_SCALE | The quantization scale is a measure of the precision of the image data. The pixel values of the compressed output image are accurate to within half of the scale value. | Only floating point MG4 images use the quantization compression type.
IMAGE::SOM | Start of metadata |
IMAGE::TRANSPARENT_DATA_VALUE | Sample values for the "no data" pixel | Stored as an array of values, one for each band, in order. Values are stored in the datatype of the samples
IMAGE::WIDTH | Width of the image, in pixels (uint32) |
IMAGE::X_RESOLUTION | Georeferencing pixel resolution in x-direction (double) |
IMAGE::XY_ORIGIN | Georeferencing (x,y) location for the center of the upper left corner pixel | Stored as an array of two doubles
IMAGE::Y_RESOLUTION | Georeferencing pixel resolution in x-direction (double) |

###### Values for IMAGE::MODIFICATIONS Tag

The following are acceptable as values for the IMAGE::MODIFICATIONS tag:

- LOSSLESS – this value will only ever appear by itself, and indicates that the pixels have been losslessly compressed and can be recovered in their original form.
- COMPRESSED – the image has been compressed at a rate that did not preserve the pixels losslessly.
- CROPPED – some of the original extent of the image has been cropped (those pixels have been discarded).
- EMBEDDED – the image has been embedded in a larger extent (new pixels have been added to the image.
- SCALED – the image has been made larger or smaller by stretching, using interpolation or wavelet decomposition.
- MASKED – some pixels from the image have been masked out (made transparent).
- INTERPRETED-ALPHA – the original image had an alpha band which was dropped or reconstructed from transparency information.
- REORDERED-BANDS – the bands represent a reordering and/or subset of the bands as they were in the original image.
- TRANSFORMED-COLORSPACE – the original pixel colors were transformed into a different colorspace.
- CHANGED-DATATYPE – the image datatype is not the same as that of the original.
- ALTERED-COLOR – the image has been color-balanced.
- MOSAICKED – the image was created from more than one source image. In this case, MODIFICATIONS flags from all component tiles have been incorporated into the resulting image.
- REPROJECTED – the image was warped to a different projection system.
- WATERMARKED – a watermark has been added to the image.
- OVERLAID – the image has had other information (text or vector data) superimposed on it.
- QUANTIZED – the image was created with the quantization compression method. Quantization is a lossy compression method that reduces the precision of pixel values in the image. Quantization is required to compress floating point MG4 images.

###### Area of Interest (AOI) Tags

The tags in the table below apply only to images encoded with areas of interest:

Area of Interest (AOI)Tags
Tag | Description | Notes
--- | --- | ---
IMAGE::AOI::n::REGION::VECTOROVERLAY | Name of vector overlay file, if any – (string) |
IMAGE::AOI::n::REGION::VECTOROVERLAY_LAYER | Layer number from vector overlay file (if one is used) – (integer) |
IMAGE::AOI::n::REGION::X | Upper left X pos of region – (integer) |
IMAGE::AOI::n::REGION::Y | Upper left Y pos of region – (integer) |
IMAGE::AOI::n::METHOD | The AOI method used – (string) | Values: "shift inner" "shift outer" "weight"
IMAGE::AOI::n::WEIGHT | Weight value used – (double) |
IMAGE::AOI::n::MAGNIFICATION | Magnification at which AOI was applied – (double) |
IMAGE::AOI::n::NAME | Optional name of AOI region – (string) |
IMAGE::AOI::n::COMMENT | Optional comment for AOI region – (string) |
IMAGE::AOI::n::URL | Optional URL referring to AOI region – (string) |

###### MG2-Only Tags

The classical tags in the table below apply to MG2 images only:

MG2-Only Tags
Tag | Description | Notes
--- | --- | ---
IMAGE::COMPRESSION_BLOCK_SIZE | Block size used in MrSID encoding (uint32) |
IMAGE::COMPRESSION_GAMMA | G-weight value used in MrSID encoding (float) |
IMAGE::COMPRESSION_VERSION | Version of encoder used (array of 3 sint32 values) |
IMAGE::COMPRESSION_WEIGHT | Weight value used in MRSID encoding (float) |
IMAGE::CREATION_DATE | Date and time of image encoding (string) |
IMAGE::COMPRESSION_NLEV | Number of zoom (resolution) levels in the image (uint32) |
IMAGE::STATISTICS:MAXIMUM | Maximum sample values for each band in the input image (array of values) | The number and datatype of the values correspond to the number of bands and sample type of the image
IMAGE::STATISTICS:MINIMUM | Maximum sample values for each band in the input image (array of values) | The number and datatype of the values correspond to the number of bands and sample type of the image
IMAGE::STATISTICS:MEAN | Average value of all samples for each band (array of doubles) |
IMAGE::STATISTICS:STANDARD_DEVIATION | Standard deviation of all samples for each band |
IMAGE::TARGET_COMPRESSION_RATIO | Compression ratio used for encoding (float) | For MG2, this only approximates the actual compression ratio achieved

###### Other Metadata Tags

When using GeoTIFF input images, the GeoTIFF metadata tags are copied directly into the MrSID or JPEG 2000 file. When using ERDAS IMAGINE and USGS DOQ metadata, certain other custom metadata tags are inserted as well.