Full Name | JPEG2000 Extensions |
Format ID | ImGearFormats.JPX |
File Extension(s) | *.jpx |
Data Type | Raster Image |
Data Encoding | Binary |
IG Multipage Support | No |
IG Alpha Channel Support | Yes |
IG Metadata Update Support | Page |
IG Platforms Support | WIN32, WIN64, .NET, .NET64 |
JPX format requires ImageGear.Formats.JPEG2K Namespace. |
ImageGear Supported Versions
ISO/IEC 15444-2:2000
ImageGear Supported Features
- IGFilterFormatFlags.DETECTSUPPORT - autodetection
- IGFilterFormatFlags.PAGEREADSUPPORT - single page file reading
- IGFilterFormatFlags.PAGEINSERTSUPPORT - single-page file writing
- IGFilterFormatFlags.MPAGEREADPSUPPORT – multi-page file writing
ImageGear Read Support
- ImGearCompressions.JPEG2K:
- Indexed RGB: 1..8 bpc
- Grayscale: 1..16 bpc
- RGB: 1..16 bpc
- YCbCr: 1..16 bpc
- Lab: 1..16 bpc
- CMY: 1..16 bpc
- CMYK: 1..16 bpc
- Grayscale + Alpha: 1..16 bpc
- Grayscale + Pre-multiplied Alpha: 1..16 bpc
- RGB + Alpha: 1..16 bpc
- RGB + Pre-multiplied Alpha: 1..16 bpc
- Indexed RGB + Extra: 1..16 bpc
- Grayscale + Extra: 1..16 bpc
- RGB +Extra: 1..16 bpc
- YCbCr +Extra: 1..16 bpc
- Lab +Extra: 1..16 bpc
- CMY +Extra: 1..16 bpc
- CMYK +Extra: 1..16 bpc
- Grayscale + Alpha + Extra: 1..16 bpc
- Grayscale + Pre-multiplied Alpha + Extra: 1..16 bpc
- RGB + Alpha + Extra: 1..16 bpc
- RGB + Pre-multiplied Alpha + Extra: 1..16 bpc
ImageGear Write Support
- ImGearCompressions.JPEG2K:
- Indexed RGB: 1..8 bpc
- Grayscale: 1..16 bpc
- RGB: 1..16 bpc
- YCbCr: 1..16 bpc
- Lab: 1..16 bpc
- CMY: 1..16 bpc
- CMYK: 1..16 bpc
- Grayscale + Alpha: 1..16 bpc
- Grayscale + Pre-multiplied Alpha: 1..16 bpc
- RGB + Alpha: 1..16 bpc
- RGB + Pre-multiplied Alpha: 1..16 bpc
- Grayscale + Extra: 1..16 bpc
- RGB +Extra: 1..16 bpc
- YCbCr +Extra: 1..16 bpc
- CMY +Extra: 1..16 bpc
- CMYK +Extra: 1..16 bpc
ImageGear Filter Control Parameters
Filter Control Parameter |
Type |
Default Value |
Available Values |
Description | ||||
CodeBlockSize |
Int |
64 |
4, 8, 16, 32, 64 |
Affects image saving. Nominal code-block dimension. Actual dimension is subject to precinct, tile, and image dimensions. | ||||
CodeBlockStyle |
Any combination of ImGearJPEG2KCodeBlockStyles Enumeration values. |
Affects image saving. Block coder mode switches. Any combination of values from ImGearJPEG2KCodeBlockStyles Enumeration is legal. | ||||||
DiscardLevels |
Int |
0 |
Any non-negative integer value. |
Affects image loading. Allows loading a smaller version of the image, which takes less time and memory than loading the whole image. This parameter indicates the number of highest resolution DWT levels which will be skipped during the reading. Dimensions of the image loaded with DiscardLevels = N will be 2^N times smaller than the actual image dimensions. If the specified number exceeds the number of DWT levels in the image, the lowest resolution level will be loaded. For this parameter to take effect, the image must have more than one DWT level. Use the WaveletLevels parameter to specify the number of DWT levels for JPEG 2000 image saving. | ||||
EbcotBitplaneShift |
Int |
0 |
0, 3 |
This control parameter should be used in combination with the CodeBlockStyle control parameter. Setting EbcotBitplaneShift to 3 and CodeBlockStyle to ImGearJPEG2KCodeBlockStyles.BYPASS enables a notable encoder speed-up between 10% and 20% over regular coding bypass mode, and a speed-up of up to 40% over regular coding mode. A similar speed-up can be expected in decoding images that have been encoded in this mode. Images saved in this mode are slightly larger in size but load faster. A value of 0 disables the feature; a value of 3 enables it. The rest of the values are reserved and result in an error upon attempting to set. The feature is disabled by default. | ||||
FileFormat |
Any ImGearJPEG2KType Enumeration value |
Affects image saving. Specifies whether to save the file as a JP2-compatible file or as a raw JPEG 2000 code-stream. JP2 compatible files contain various metadata, such as resolution, color space, palette, XML, etc. Raw code-streams do not store any metadata. | ||||||
LoadComposition |
bool |
false |
false |
This parameter is reserved for future use. Set to false. | ||||
Mode |
Any ImGearJPEG2KModes Enumeration value. |
This parameter has been deprecated. | ||||||
ProgressionOrder |
Affects image saving. This parameter specifies the progression order to be used by the result file. See ImGearJPEG2KProgressionOrders Enumeration for available progression orders. | |||||||
QualityLayers |
double[] |
new double[0] |
Array of one or more double values, or null. |
Affects image saving. This parameter represents a more powerful version of the RateBytes control parameter. Its value is an array of one or more bit-rates, expressed in terms of the ratio between the total number of compressed bits in the code stream (including code stream header, but not including JP2 header) and the number of pixels in the image (image width * height). The number of elements in the array represents the number of quality layers. Each value in the array represents the overall bit-rate of this layer, rather than the difference between this layer and the previous layer. In order to use the maximum quality for the last layer, set the last element of the array to 0.0.
Example: Set QualityLayers to {0.01, 0.1, 0.5} If the source image dimensions are 800 x 600 = 480000 pixels, the array used in the example will result in the following layer sizes:
| ||||
QuantizationStep |
double |
-1.0 |
Any negative value; 0.0…2.0 |
Affects image saving. This control parameter is the base step size to be used in deriving irreversible quantization step sizes for every sub-band. Any negative value results in automatic selection of the quantization step size. This is the recommended mode. | ||||
RateBytes |
Int |
0 |
Any non-negative integer value. |
Affects image saving. This control parameter specifies the maximal size of the saved code stream in bytes. A zero value instructs the filter to use the highest compression quality.
| ||||
StitchTiles |
bool |
true |
true, false |
Affects image loading. This parameter specifies how tiled images should be loaded. If true then ImageGear loads and stitches (composes together) all tiles automatically into the resulting image. If false then ImageGear loads a single tile. | ||||
TileHeight |
Int |
0 |
Any non-negative integer value. |
Affects image loading. Specifies the height of one tile in the reference grid. A zero value indicates the image's height. | ||||
TileWidth |
Int |
0 |
Any non-negative integer value. |
Affects image loading. Specifies the width of one tile in reference grid. A zero value indicates the image's width. | ||||
ViewHeight |
Int |
0 |
Any non-negative integer value. |
Affects image loading. Allows loading a smaller version of the image, which takes less time and memory than loading the whole image. If the value is nonzero, or is greater than the image height, ImageGear only loads DWT levels whose height is not greater than the parameter value. Dimensions of each decomposition level are twice greater than that of the previous level. A zero value indicates the initial image's height. This parameter is similar to DiscardLevels in that it allows you to select the highest resolution level for image loading. | ||||
ViewWidth |
Int |
0 |
Any non-negative integer value. |
Affects image loading. Allows loading a smaller version of the image, which takes less time and memory than loading the whole image. If the value is nonzero, or is greater than the image width, ImageGear only loads DWT levels whose width is not greater than the parameter value. Dimensions of each decomposition level are twice greater than that of the previous level. A zero value indicates the initial image's height. This parameter is similar to DiscardLevels in that it allows you to select the highest resolution level for image loading. | ||||
WaveletFilter |
Any ImGearJPEG2KFilters Enumeration value. |
Affects image saving. Specifies the type of Wavelet filter (Auto, Reversible, or Irreversible) to be used for Discrete Wavelet Transform.
| ||||||
WaveletLevels |
Int |
-1 |
-1 … 16 |
Affects image saving. Specifies the quantity of decomposition levels (stages) for the image being saved. The main purpose of each level is to provide the ability for the reader to faster decompress the reduced size version of the original image. Dimensions of the Nth level are 2^N times smaller than the actual image dimensions. Setting this parameter to -1 tells ImageGear to select the value automatically. Currently, ImageGear uses 5 levels for all types of images in this mode. |
Non-Image Data Structure
ImageGear JPX format filter allows you to work with non-image data stored in supported file formats. It provides metadata tags that make possible manipulating with such kinds of non-image information:
- XML & IPR information,
- Alpha channels mapping,
- Chroma keys,
- Composition layers
The following metadata tags are available to work with JPX files:
"AlphaMapping"
This tag establishes the relationship, if any, between color channels and alpha (and/or pre-multiplied) alpha channels. Each element of array specifies number of alpha channel associated with regular (color) channel. Zero or negative value means absence of alpha mapping for particular color channel. For example:
"AlphaMapping" with {1, 1, 1, -1} as value means that all red, green and blue channels of image are mapped to single (first) alpha channel, which available under 0-index for current image through ImageGear API. {-1, 2, 1, -1} value means availability of two different alpha channels for green and blue channels and absence of alpha channel for red channel.
Additional information about available alpha channels can be accessed through "Alpha1", "Alpha2", "Alpha3" and "Alpha4" tags.
"Alpha1", "Alpha2", "Alpha3", "Alpha4"
Each of these tags represents information about alpha channels. Valid value for each tag is array with three integer elements. First element represents index of codestream (-1 or non-negative value), in which alpha channel is (or "should be" in case of write) resided. Second - index of component in which alpha is stored (-1 or non-negative value). Last element specifies whether alpha is regular (0) or pre-multiplied (1). For example:
"Alpha1" with {0, 3, 0} as value means that first alpha channel is regular and located in fourth component of the first codestream. {1, 0, 1} value represents pre-multiplied alpha in first component of second codestream in JPX layer.
For JP2 file format value of the first element (code-stream index) is restricted to {-1, 0} set. Only for JPX files it's allowed to store alpha channels in separate code-stream. |
"Chroma"
This tag contains an array of values each of which is treated as fully-transparent for a particular channel. Negative value of any element means absence of chroma-key.
"ComposedLayersQty"
This tag specifies the number of composed layers involved into loaded composition. It appears only for images loaded by JPX filter with value of LoadComposition control parameter set to True.
"XML"
This tag serves for getting and setting some specific information written in XML language. Please note that only JPEG2000 format is able to store XML data. It must be set as a text string.
"IPR"
This tag serves for getting and setting IPR (Intellectual Property Rights) information. The IPR metadata defines metadata to either protect the rights of the owner of the image or provide further information to request permission to use it. It is important for developers and users to properly protect the rights of the owner of the image data.
Please note that only JPEG2000 format is able to store IPR data. It must be set as a text string.
"Resolution"
This tag serves for getting the resolution information of JPEG 2000 image. It contains four fields of type double that specify resolution values, in pixels per meter:
- Capture Resolution X
- Capture Resolution Y
- Display Resolution X
- Display Resolution Y
If neither Capture nor Display resolution is present in the image the corresponding fields are set to 0.0.
Comments
JPX file format is an extension to JPEG 2000 file format. It normally uses JPEG 2000 compression, but allows other compressions as well, such as JBIG, CCITT Group3, CCITT Group4, etc. ImageGear only supports JPEG 2000 compression for JPX format. The format also provides advanced features such as multiple layers for an image, various color spaces, opacity (alpha channel), and fragmented code streams.
Metadata Update
You can use the Metadata Update API to update XML, IPR, Comment and Resolution metadata in JPEG 2000 Part 2 files. Metadata Update API can only change a single occurrence of the Comment metadata.
Capture and Display Resolutions are represented by their X and Y values that can only be updated together. An attempt to update only X or Y value leaving the other value to 0 will result in no change at all.