Use the ‑outputformat
/ ‑of
switch to specify the desired JPEG 2000 output format.
If you do not specify an output format with this switch, the default output format is MG4
.
GeoExpress supports encoding JPEG 2000 files in two different modes, “Part I” and “GMLJP2”. GMLJP2 is the best option for most workflows. For applications that do not support GMLJP2, the Part I mode generates files that do not use any Part II extensions. GMLJP2 metadata is not available in this mode. Other encoding features, such as the use of NPJE profiles and other metadata forms, are still available. Use the Part I mode only when you are sure that the image user’s workflow entails applications that cannot read GMLJP2 files.
The acceptable output format strings for JPEG 2000 encoding are:
gmljp2
: JPEG 2000jp2
: JPEG 2000 (Part I)nitfjp2
: NITF encoded as JP2Support for encoding NITF images is available for GeoExpress. Contact your LizardTech representative to purchase the NITF Extension for GeoExpress.
The information included below is provided with the assumption that the user is familiar with the JPEG 2000 standard. Parameter choices accommodated by the JPEG 2000 specification are of such a broad and varied range that it is possible for users to select settings that prove counterproductive to their goals. In particular, some optimal encode settings can result in degraded decode performance. Considerable trial and error may be required to achieve desired results when diverging from defaults and recommended settings.
All of the basic encode options and some of the advanced options that are available for MrSID encoding are also available for the JPEG 2000 format. Certain advanced operations such as creating and updating composites and optimizing images are not available for JPEG 2000 encoding.
Options available for JPEG 2000 encoding include:
specifying a target compression ratio
encoding the image losslessly
selecting the number of zoom levels the output image has
specifying a target thumbnail size
encoding the image with the maximum number of supported zoom levels
creating a “test encode”, which adds a watermark pattern and does not decrement the data cartridge
JPEG 2000 images can be created with an essentially unlimited number of bands, so multispectral output can be created from multispectral input without having to go through an output color space. When outputting MrSID data, the color compositor is restricted to creating RGB color composites, but for JPEG 2000 encoding, the color compositor allows multibanded images to be created from files representing individual bands.
For more information see Creating Multiband JPEG 2000 Files.
GeoExpress currently does not support the CMYK color space for JPEG 2000 images, either as input or output. For source images that are CMYK, the only supported output color space for JPEG 2000 encoding is grayscale. The preview input image color space controls remain the same.
Switch | Value | Notes |
---|---|---|
‑profile | string |
Specifies a predefined group of encode settings. Supported named profiles are:
|
‑bitsofprecision / ‑bop | uint | Enables you to choose how many significant bits are to be used from the samples of the source imagery. For example, an image may consist of 16-bit data values, but only eleven of those bits may be meaningful. By default full precision is used. |
‑qualitylayers / ‑ql | uint |
Indicates the number of quality layers with which to encode the image. Among other things, quality layers enable better “streaming” (progressive transmission and display) in some applications. Default: 30. |
‑tilesize / ‑ts | sint0 sint1 |
Specifies the use of tiles in encoding and their size (in pixels). If enabled, the tile size must be no larger than the dimensions of the source image. Smaller tiles reduce the amount of memory required to encode the image, however the use of tiles may introduce edge artifacts. Default: 4096 × 4096. Enter 0 × 0 to disable. |
‑flushperiod / ‑flush | uint |
Enables codestream flushing, measured in rows of pixels. When codestream flushing is enabled, less memory may be required to encode the image. The flush period should be on the order of the strip height being used. Using the flush period should not significantly affect output image quality. Default: 4096. |
‑precincts / ‑prec | string |
Specifies precinct sizes. Precincts are width-height pairs whose use may improve the performance of decode operations for certain image encodings such as those in which tiles are not used. The input format is Default for both width and height: 256. |
‑noprecincts / ‑noprec | Specifies disabling precincts. | |
-nogmljp2 | Specifies that GMLJP2 metadata should not be included. See About GML and GMLJP2. | |
‑noembedschemas | Specifies that GMLJP2 schemas should not be embedded in the output file. | |
‑tileparts / ‑tp | string |
Specifies the organization of tile parts in the codestream. Any combination of the letters
Default: |
‑progressionorder / ‑porder | string |
Progression order may have a significant impact on the time and memory usage required to encode and/or decode the image. Different progression orders should be used for different target workflows. Valid values are Default : |
‑codeblocksize / ‑cbs | sint0 sint1 |
Specifies the width and height (in pixels) of the codeblocks used to encode the image. Default: 64. Note: for JP2 codeblock size restrictions, see JPEG 2000 Encoding. |
‑usepltmarkers / ‑plt | Enables the use of packet length markers. Use of packet length markers may improve decoding performance. By default packet length markers are used. | |
‑use97wavelet | Specifies that the floating point 9-7 wavelet be used for encoding, instead of the default integer 5-3 wavelet. The 9-7 wavelet will not encode an image losslessly, however, it may result in a better looking image at higher compression ratios. This option is disabled by default and only available when the ‑lossless option is not specified. |
|
‑profilefile | string | Specifies path to a profile file to use for setting up encode properties. Additional properties set on the command line will override the profile settings. |
‑stripheight / ‑sh | sint |
Affects memory usage. Increasing this value may improve runtime performance, but at a cost of requiring more physical memory. This value should be decreased when encoding very large images. Changing the strip height does not affect the quality of the output image. Acceptable values: Even integers from 2 to the image’s height. Default: 12. |
‑tilelengthmarkers / ‑tlm | uint |
Specifies use of tile length markers and their size. Using tile length markers may improve decoding performance with tiled JPEG 2000 files. Acceptable values: 1–255 Default: 255. Enter 0 to disable. |
‑nopltmarkers / ‑noplt | Disables packet length markers. |
The following restrictions apply to JP2 codeblock size:
width and height must be powers of two
width and height must each be greater than 4
width × height must be less than 4096
width and height must each be less than width and height of tile size
width and height must each be less than width and height of image if tile size is not specified
The default codeblock value is 64 × 64.
Mosaic jobs are encoded the same way for JPEG 2000 output as for MrSID output files. See Creating a Mosaic.
If an external world file is present, its information trumps any metadata. Absent a world file, metadata are evaluated in the following order of priority:
GMLJP2
GEOJP2/GEOTIFF
MrSID metadata
World file metadata
If a world file is present, then no coordinate reference system is associated with the output file (a NULL WKT is applied).
When JPEG 2000 is specified as the output format, GMLJP2 metadata is included by default, and GML metadata is added to the output file according to the GMLJP2 Application Schema version 3.1.1., which can be found at http://schemas.opengis.net/gml/.
If GMLJP2 metadata is included, the GML schemas are embedded in the file unless the ‑noembedschemas
switch is used. XML data from the .xsd
files that comprise the GMLJP2 Application Schema is embedded in the output file, eliminating potential dependency on a network for use of the GML data included in the file. The schemas package has a fixed size of 230 KB, which must be separately factored into output file size estimates (Note: this should only be of concern if the intended output imagery is under 10MB). If the ‑noembedschemas
switch is used, software applications using the output file may need to retrieve the schemas online.
By default GeoExpress includes the schemas.
For more information about GML and the GML application schemas, see About GML and GMLJP2.
The table below indicates GeoExpress’ original or “factory” default JP2 settings. Unless you have changed your JPEG 2000 preferences, they are the settings that will serve as defaults for your JP2 encoding.
Option | Setting |
---|---|
Use of tiles | Enabled |
Tile Size | 4096 × 4096 |
Quality Layers | 30 |
Strip Height | 12 |
Flush Period | 4096 |
Progression Order | RPCL |
Code Block Size |
Width: 64 Height: 64 |
Tile Length Markers | 255 |
Tile Parts | By resolution |
Packet Length Markers | Enabled |
9-7 Wavelet (Lossy) | Disabled |
Precincts | 256 × 256 |
Metadata Forms Included in Output | MrSID, World file, GeoTIFF (GeoJP2) |