# JP2OpenJPEG --- JPEG2000 driver based on OpenJPEG library

(GDAL >= 1.8.0)

This driver is an implementation of a JPEG2000 reader/writer based on OpenJPEG library v2.

The v2 branch is - at the time of writing - still unreleased, so you'll have to pull it yourself from its Subversion repository : http://openjpeg.googlecode.com/svn/branches/v2. OpenJPEG trunk is still deriving on the 1.3 series that doesn't provide access to tile-level reading. v2 branch enables reading big JPEG2000 images without loading them entirely in memory. This is a noticeable improvement in comparison with the JPEG2000 driver based on Jasper library.

The v2 branch also adds the capability to use the VSI Virtual File API, so the driver is able to read JPEG2000 compressed NITF files.

Starting with GDAL 1.9.0, XMP metadata can be extracted from JPEG2000 files, and will be stored as XML raw content in the xml:XMP metadata domain.

In creation, the driver doesn't support writing GeoJP2 nor GMLJP2.

## Creation Options

- CODEC=JP2/J2K : JP2 will add JP2 boxes around the codestream data. The value is determined automatically from the file extension. If it's neither JP2 nor J2K, J2K codec is used.

- QUALITY : Percentage between 0 and 100. A value of 50 means the file will be half-size in comparison to uncompressed data, 33 means 1/3, etc.. Defaults to 25

- REVERSIBLE=YES/NO : YES means lossless compression. Defaults to NO.

- RESOLUTIONS : Number of resolution levels. Between 1 and 7. Defaults to 6.

- BLOCKXSIZE : Tile width. Defaults to 1024.

- BLOCKYSIZE : Tile height. Defaults to 1024.

- PROGRESSION : Progession order : LRCP, RLCP, RPCL, PCRL or CPRL. Defaults to LRCP.

- SOP=YES/NO : YES means generate SOP marker segments. Defaults to NO.

- EPH=YES/NO : YES means generate EPH marker segments. Defaults to NO.

## Patches for OpenJPEG library :

Links to usefull patches to apply to OpenJPEG (valid for v2 branch in revision r565) :

- Fix leak in jp2_read_header_procedure()

- Fix internal function names conflict with Jasper that can cause crashes

## See Also:

- Implemented as `gdal/frmts/openjpeg/openjpegdataset.cpp`.

- Official JPEG-2000 page

- The OpenJPEG library home page

Other JPEG2000 GDAL drivers :

- JPEG2000: based on Jasper library (open source)

- JP2ECW: based on Erdas ECW library (commercial)

- JP2MRSID: based on LizardTech MrSID library (commercial)

- JP2KAK: based on Kakadu library (commercial)