JPEG2000 is an open, international standard for image compression based on wavelet technology. It offers multiple advantages over other image file standards and compression methods. Among these advantages are:
A JPEG2000 encoded image and its most basic metadata comprise a code stream. This raw code stream may be placed in a file, usually given an extension of .j2k.
The JPEG2000 standard also allows for additional application-specific metadata to be added to a JPEG2000 file. A file that encapsulates the raw code stream and contains this additional metadata is referred to as a JP2 format file. IDL's support of the JP2 standard provides access to the following additional metadata types: color system specifications, palettes, XML containers, and display resolution information. These metadata are exposed through the COLOR_SPACE, PALETTE, XML, and DISPLAY_RESOLUTION object properties. (See Properties).
| Note |
.jp2 or .jpx (which are case insensitive).
The IDLffJPEG2000 object class in IDL provides access to the features of JPEG2000 and the JP2 file format for both input and output. This object class is detailed in the following section.
| Note |
JPEG2000 uses the concept of the canvas to align multiple image components and tiles in a single coordinate system. This section explains the layout of image components and tiles within the canvas coordinate system.
By default, images are placed on the canvas so that the image and canvas origins align. If an image offset is specified, the origin of all image components will be located at the specified X and Y offsets from the canvas origin.
Each image component can also be subsampled. The subsampling factors for a component indicate the scaling factor between the component dimensions and the image dimensions. If an image has dimensions XI by YI, and a component has subsampling factors XS by YS, the dimensions of the component will be the ceiling of XI/XS by the ceiling of YI/YS. For example, suppose an image has an overall size of 512 by 384 samples. An image component that has subsampling factors of 2 by 2 will have dimensions 256 by 192 samples. Calling the GetData method to retrieve just this component will return a 256 by 192 array.
In the canvas coordinate system, the subsampling factors have been applied to each component so that the dimensions of all components are always equal.
| Note |
| Note |
object->GetProperty, DIMENSIONS = dimensions, $
SUBSAMPLING = subsampling, N_COMPONENTS = n_components
comp_sizes = ULONARR(2, n_components)
FOR i = 0, n_components - 1 do $
comp_sizes[*,i] = CEIL(FLOAT(dimensions) / subsampling[*,i])
By default, images will have one tile that has the same dimensions and offset on the canvas as the image. If the tile dimensions are smaller than the image dimensions and the tile offsets are different than the images offsets, some tiles may extend beyond the borders of the image.
The values returned via the TILE_DIMENSIONS and TILE_OFFSET keywords in the GetTileProperty method are the dimensions and location of the tile on the image itself, and not necessarily the dimensions and location on the canvas. To determine the overall dimensions of a tile, whether or not it falls outside the boundaries of the image, check the TILE_DIMENSIONS property with the GetProperty method.