Home | Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]

Overview of IDL and JPEG2000


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 format files must always have the file-type extension of .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
Portions of IDL's JPEG2000 functionality were developed using Unisearch's Kakadu software, for which Kodak has a commercial license. Kakadu Software. Copyright © 2001. The University of New South Wales, UNSW, Sydney NSW 2052, Australia, and Unisearch Ltd, Australia.

The JPEG2000 Canvas Coordinate System

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.

Image Offsets and Image Subsampling

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
When reading a region within the image with the GetData method, the values passed to the REGION keyword ([StartX, StartY, Width, Height]) are measured in the canvas coordinate system. The StartX and StartY values are measured from the canvas origin, and the Width and Height values are measured after any subsampling has been applied to the image components. This allows a single set of Width and Height values to be used for every component.

Note
If all components in an image have subsampling factors of 1 by 1, the dimensions of each component will be equal to the value contained in the DIMENSIONS property. To calculate the dimensions of individual components when some components have subsamplings other than 1 by 1, the following code can be used:

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])

Tile Dimensions and Tile Offsets

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.


Home | Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]