/** \page IMG HDF5 Image and Palette Specification Version 1.2
Navigate back: \ref index "Main" / \ref SPEC
Table 1. Attributes of an Image Dataset
| Attribute Name |
Required or Optional |
Type |
String Size |
Value |
Description |
| CLASS |
Required |
String |
5 |
"IMAGE" |
This attribute is type #H5T_C_S1, with size 5. For all Images, the value of
this attribute is "IMAGE". This attribute identifies this data set as intended
to be interpreted as an image that conforms to the specifications on this page. |
| PALETTE |
Optional |
Array Object References |
|
<references to Palette datasets>1 |
A Image dataset within an HDF5 file may optionally specify an array of
palettes to be viewed with. The dataset will have an attribute field called
"PALETTE" which contains a one-dimensional array of object reference
pointers (HDF5 datatype #H5T_STD_REF_OBJ) which refer to palettes in the
file. The palette datasets must conform to the Palette specification in
\ref sec_tab_spec_sect2. The first palette in this array will be the default palette
that the data may be viewed with. |
| IMAGE_SUBCLASS |
Optional2 |
String |
15, 12, 15, 13 |
"IMAGE_GRAYSCALE", "IMAGE_BITMAP", "IMAGE_TRUECOLOR", "IMAGE_INDEXED" |
If present, the value of this attribute indicates the type of Palette that
should be used with the Image. This attribute is a scalar of type
#H5T_C_S1, with size according to the string plus one. The values
are:
- IMAGE_GRAYSCALE (length 15) A grayscale image
- IMAGE_BITMAP (length 12) A bit map image
- IMAGE_TRUECOLOR (length 15) A truecolor image
- IMAGE_INDEXED (length 13) An indexed image
|
| INTERLACE_MODE |
Optional3,6 |
String |
15 |
The layout of components if more than one component per pixel. |
For images with more than one component for each pixel, this optional attribute
specifies the layout of the data. The values are type #H5T_C_S1 of length
15. See \ref subsec_image_spec_spec_store for information about the
storage layout for data.
- INTERLACE_PIXEL (default): the component values for a pixel are contiguous.
- INTERLACE_PLANE: each component is stored as a plane.
|
| DISPLAY_ORIGIN |
Optional |
String |
2 |
If set, indicates the intended location of the pixel (0,0). |
This optional attribute indicates the intended orientation of the data
on a two-dimensional raster display. The value indicates which corner
the pixel at (0, 0) should be viewed. The values are type #H5T_C_S1
of length 2. If DISPLAY_ORIGIN is not set, the orientation is undefined.
- UL: (0,0) is at the upper left.
- LL: (0,0) is at the lower left.
- UR: (0,0) is at the upper right.
- LR: (0,0) is at the lower right.
|
| IMAGE_WHITE_IS_ZERO |
Optional3,4 |
Unsigned Integer |
|
0 = false, 1 = true |
This attribute is of type #H5T_NATIVE_UCHAR. 0 = false, 1 = true .
This is used for images with IMAGE_SUBCLASS="IMAGE_GRAYSCALE" or "IMAGE_BITMAP". |
| IMAGE_MINMAXRANGE |
Optional3,5 |
Array [2] <same datatype as data values> |
|
The (<minimum>, <maximum>) value of the data. |
If present, this attribute is an array of two numbers, of the same HDF5
datatype as the data. The first element is the minimum value of the
data, and the second is the maximum. This is used for images with
IMAGE_SUBCLASS="IMAGE_GRAYSCALE", "IMAGE_BITMAP" or "IMAGE_INDEXED". |
| IMAGE_BACKGROUNDINDEX |
Optional3 |
Unsigned Integer |
|
The index of the background color. |
If set, this attribute indicates the index value that should be interpreted
as the "background color". This attribute is HDF5 type #H5T_NATIVE_UINT. |
| IMAGE_TRANSPARENCY |
Optional3,5 |
Unsigned Integer |
|
The index of the transparent color. |
If set, this attribute indicates the index value that should be interpreted
as the "transparent color". This attribute is HDF5 type #H5T_NATIVE_UINT.
This attribute may not be used for IMAGE_SUBCLASS="IMAGE_TRUECOLOR". |
| IMAGE_ASPECTRATIO |
Optional3,4 |
Unsigned Integer |
|
The aspect ratio. |
If set, this attribute indicates the aspect ratio. |
| IMAGE_COLORMODEL |
Optional3,6 |
String |
3, 4, or 5 |
The color model, as defined below in the Palette specification for
attribute PAL_COLORMODEL. |
If set, this attribute indicates the color model of Palette that should
be used with the Image. This attribute is of type #H5T_C_S1, with
size 3, 4, or 5. The value is one of the color models described in
the Palette specification in \ref subsec_tab_spec_sect2_22.
This attribute may be used only for IMAGE_SUBCLASS="IMAGE_TRUECOLOR" or
"IMAGE_INDEXED". |
| IMAGE_GAMMACORRECTION |
Optional3,6 |
Float |
|
The gamma correction. |
If set, this attribute gives the Gamma correction. The attribute
is type #H5T_NATIVE_FLOAT. This attribute may be used only for IMAGE_SUBCLASS="IMAGE_TRUECOLOR"
or "IMAGE_INDEXED". |
| IMAGE_VERSION |
Required |
String |
3 |
"1.2" |
This attribute is of type #H5T_C_S1, with size corresponding to the length
of the version string. This attribute identifies the version number
of this specification to which it conforms. The current version number
is "1.2". |
Image datasets may be stored with any chunking or compression properties
supported by HDF5.
A note concerning compatibility with HDF5 GR interface: An Image
dataset is stored as an HDF5 dataset. It is important to note that
the order of the dimensions is the same as for any other HDF5 dataset.
For a two dimensional image that is to be stored as a series of horizontal
scan lines, with the scan lines contiguous (i.e., the fastest changing
dimension is 'width'), the image will have a dataspace with dim[0] =
height and dim[1] = width. This is completely consistent
with all other HDF5 datasets.
Users familiar with HDF4 should be cautioned that this is not the
same as HDF4, and specifically is not consistent with what the HDF4
GR interface does.
\section sec_tab_spec_sect2 HDF5 Palette Specification
\subsection subsec_tab_spec_sect2_21 Overview
A palette is the means by which color is applied to an image and is also
referred to as a color lookup table. It is a table in which every row contains
the numerical representation of a particular color. In the example of an
8 bit standard RGB color model palette, this numerical representation of
a color is presented as a triplet specifying the intensity of red, green,
and blue components that make up each color.
Table 4. Attributes of a Palette Dataset
| Attribute Name |
Required or Optional |
Type |
String Size |
Value |
Description |
| CLASS |
Required |
String |
7 |
"PALETTE" |
This attribute is of type H5T_C_S1, with size 7.For all palettes, the value of this attribute is "PALETTE". This attribute
identifies this palette data set as a palette that conforms to the specifications
on this page. |
| PAL_COLORMODEL |
Required |
String |
3, 4, or 5 |
Color Model: "RGB", "YUV", "CMY", "CMYK", "YCbCr", or "HSV" |
This attribute is of type H5T_C_S1, with size 3, 4, or 5.
Possible values for this are "RGB", "YUV", "CMY", "CMYK", "YCbCr", "HSV".
This defines the color model that the entries in the palette data set represent.
- "RGB"
- Each color index contains a triplet where the first value defines the
red component, second defines the green component, and the third the blue
component.
- "CMY"
- Each color index contains a triplet where the first value defines the
cyan component, second defines the magenta component, and the third the
yellow component.
- "CMYK"
- Each color index contains a quadruplet where the first value defines
the cyan component, second defines the magenta component, the third the
yellow component, and the forth the black component.
- "YCbCr"
- Class Y encoding model. Each color index contains a triplet where the
first value defines the luminance, second defines the Cb Chromonance, and
the third the Cr Chromonance.
- "YUV"
- Composite encoding color model. Each color index contains a triplet where
the first value defines the luminance component, second defines the
chromonance component, and the third the value component.
- "HSV"
- Each color index contains a triplet where the first value defines the
hue component, second defines the saturation component, and the third the
value component. The hue component defines the hue spectrum with a low
value representing magenta/red progressing to a high value which would
represent blue/magenta, passing through yellow, green, cyan. A low value
for the saturation component means less color saturation than a high value.
A low value for value will be darker than a high value.
|
| PAL_TYPE |
Required |
String |
9
|
"STANDARD8"
| or "RANGEINDEX" (Deprecated) |
|---|
|
This attribute is of type H5T_C_S1, with size 9 or 10.
The current supported values for this attribute are: "STANDARD8" or "RANGEINDEX".
A PAL_TYPE of "STANDARD8" defines a palette dataset such that the first
entry defines index 0, the second entry defines index 1, etc. up until
the length of the palette - 1. This assumes an image dataset with direct
indexes into the palette.
| Deprecated If the PAL_TYPE is set to "RANGEINDEX", there will
be an additional attribute with a name of PAL_RANGEINDEX, (See example 2
for more details) |
- Attribute name="PAL_RANGEINDEX" (Deprecated)
- The PAL_RANGEINDEX attribute contains an HDF object reference (HDF5
datatype H5T_STD_REF_OBJ) pointer which specifies a range index array in
the file to be used for color lookups for the palette. (Only for
PAL_TYPE="RANGEINDEX")
|
|
|
|
|
|
| <Object Reference to Dataset of range index values> |
|---|
|
|
| PAL_MINMAXNUMERIC |
Optional |
Array[2] of <same datatype as palette> |
|
The first value is the <Minimum value for color values>, the second
value is <Maximum value for color values>2 |
If present, this attribute is an array of two numbers, of the same HDF5
datatype as the palette elements or color numerics.
They specify the minimum and maximum values of the color numeric components.
For example, if the palette was an RGB of type Float, the color numeric
range for Red, Green, and Blue could be set to be between 0.0 and 1.0.
The intensity of the color guns would then be scaled accordingly to be
between this minimum and maximum attribute. |
| PAL_VERSION |
Required |
String |
4 |
"1.2" |
This attribute is of type H5T_C_S1, with size corresponding to the
length of the version string. This attribute identifies the version
number of this specification to which it conforms. The current version
is "1.2". |