JPEG 2000

From Wikipedia, the free encyclopedia

JPEG 2000

Comparison of JPEG 2000 with the original JPEG format.
File extension: .jp2, .j2c
MIME type: image/jp2
Developed by: Joint Photographic Experts Group
Type of format: graphics file format

JPEG 2000 is a wavelet-based image compression standard. It was created by the Joint Photographic Experts Group committee with the intention of superseding their original discrete cosine transform-based JPEG standard. The standardized filename extensions is .jp2 for ISO/IEC 15444-1 conforming files and .jpx for the extended part-2 specifications, published as ISO/IEC 15444-2, while the MIME type is image/jp2.

JPEG 2000 can operate at higher compression ratios without generating the characteristic 'blocky and blurry' artifacts of the original DCT-based JPEG standard. It also allows more sophisticated progressive downloads.

Part of JPEG 2000 has been published as an ISO standard, ISO/IEC 15444-1:2000. As of 2007, JPEG 2000 is not widely supported in web browsers, and hence is not generally used on the World Wide Web. Even though provisions have been made to integrate all kinds of external meta-data, there is currently no accepted way to embed Exif data.

Contents

[edit] Advantages

There are several claimed advantages of JPEG2000 over the ordinary JPEG standard:

  • Superior compression performance: At high bit rates, where artifacts become nearly imperceptible, JPEG 2000 has a compression advantage over JPEG by roughly 20% on average. At lower bit rates, JPEG 2000 has a much more significant advantage over certain modes of JPEG. The compression gains over JPEG are attributed to the use of DWT and a more sophisticated entropy encoding scheme.
  • Multiple resolution representation: JPEG2000 provides seamless compression of multiple image components, with each component carrying from 1 to 16 bits per component sample. With tiling, it handles images of arbitrary large size in a single codestream.
  • Progressive transmission by pixel and resolution accuracy, commonly referred to as progressive decoding and signal-to-noise ratio (SNR) scalability: JPEG2000 provides efficient codestream organizations which are progressive by pixel accuracy, by quality (SNR), by resolution or by size.
  • Lossless and lossy compression: JPEG2000 provides both lossless and lossy compression in a single compression architecture. Lossless compression is provided by the use of a reversible (integer) wavelet transform.
  • Random codestream access and processing, also referred as Region Of Interest (ROI): JPEG2000 codestreams offer several mechanisms to support spatial random access or region of interest access at varying degrees of granularity.
  • Error resilience: JPEG2000 is robust to bit errors introduced by noisy communication channels. This is accomplished by the inclusion of resynchronization markers, the coding of data in relatively small independent blocks, and the provision of mechanisms to detect and conceal errors within each block.
  • Sequential buildup capability: JPEG2000 allows for encoding of an image from top to bottom in a sequential fashion without the need to buffer an entire image.
  • Flexible file format: The JP2 and JPX file formats allow for handling of color-space information, metadata, and for interactivity in networked applications as developed in the JPEG Part 9 JPIP protocol.

More advantages associated with JPEG 2000 can be referred to from the Official JPEG 2000 page.

[edit] Related standards

Several additional parts of the JPEG 2000 standard exist; Amongst them are ISO/IEC 15444-2:2000, JPEG 2000 extensions defining the .jpx file format, featuring for example trellis quantization, an extended file format and additional color transformations, ISO/IEC 15444-4:2000, the reference testing and ISO/IEC 15444-6:2000, the compound image file format, allowing compression of compound text/image graphics.

Recently, a JPEG2000 based image browsing protocol, called JPIP has been published as ISO/IEC 15444-9. Within this framework, only selected regions of potentially huge images have to be transmitted from an image server on the request of a client, thus reducing the required bandwidth.

Extensions for secure image transfer, JPSEC, enhanced error-correction schemes for wireless applications, JPWL, and extensions for encoding of volumetric images, JP3D are currently under discussion by the ISO.

[edit] Technical discussion

The aim of JPEG 2000 is not only improved compression performance over JPEG but also adding (or improving) features such as scalability and editability. In fact, JPEG 2000's improvement in compression performance relative to the original JPEG standard is actually rather modest and should not ordinarily be the primary consideration for evaluating the design. Moreover, very low and very high compression rates (including lossless compression) are also supported in JPEG 2000. In fact, the graceful ability of the design to handle a very large range of effective bit rates is one of the strengths of JPEG 2000. (For example, to reduce the number of bits for a picture below a certain amount, the advisable thing to do with the first JPEG standard is to reduce the resolution of the input image before encoding it — something that is ordinarily not necessary for that purpose when using JPEG 2000 because of its wavelet scalability properties.)

JPEG 2000, as did the original JPEG 1992 standard, applies a form of transform coding to compress images. However, JPEG 2000 uses the CDF 9/7 wavelet transform for lossy coding, in contrast to JPEG 1992 which uses an 8x8 block-size discrete cosine transform.

Initially, images have to be transformed (from the RGB color space) to the well known YCbCr color space or to the RCT space (reversible component transform) leading to three components. In lossless mode a very rough, but reversible, approximation of this color space conversion is used. The chrominance components can be, but do not necessarily have to be, down-scaled in resolution; in fact, since the wavelet transformation already separates images into scales, downsampling is more effectively handled by dropping the finest wavelet scale. This step is called multiple component transformation in the JPEG 2000 language since its usage is not restricted to the RGB color model.

After color transformation, the image is split into so-called tiles, rectangular regions of the image that are transformed and encoded separately. The purpose of tiles is to cope with memory limitations more easily. These tiles are then wavelet transformed to an arbitrary depth.

The result is a collection of sub-bands which represent several approximation scales. A sub-band is a set of coefficientsreal numbers which represent aspects of the image associated with a certain frequency range as well as a spatial area of the image. These coefficients are scalar-quantized, giving a set of integer numbers which have to be encoded bit-by-bit.

The quantized sub-bands are split further into precincts, rectangular regions in the wavelet domain. They are typically selected in a way that the coefficients within them across the sub-bands form approximately spatial blocks in the (reconstructed) image domain, though this is not a requirement.

Precincts are split further into code-blocks. Code-blocks are located in a single sub-band and have equal sizes — except those located at the edges of the image. The encoder has to encode the bits of all quantized coefficients of a code-block, starting with the most significant bits and progressing to less significant bits by a process called the EBCOT scheme. EBCOT here stands for Embedded Block Coding with Optimal Truncation. In this encoding process, each bit-plane of the codeblock gets encoded in three so-called coding passes, first encoding bits (and signs) of insignificant coefficients with significant neighbors (i.e. with 1-bits in higher bit-planes), then refinement bits of significant coefficients and finally coefficients without significant neighbours. The three passes are called Significance Propagation, Magnitude Refinement and Cleanup Pass, respectively.

The bits selected by these coding passes then get encoded by a context-driven binary arithmetic coder, namely the binary MQ-coder. The context of a coefficient is formed by the state of its nine neighbours in the codeblock.

The result is a bit-stream that is split into packets where a packet groups selected passes of all codeblocks from a precinct into one indivisible unit. Packets are the key to quality scalability (i.e. packets containing less significant bits can be discarded to achieve lower bit-rates and higher distortion).

Packets from all sub-bands are then collected in so-called layers. The way the packets are built up from the code-block coding passes, and thus which packets a layer will contain, is not defined by the JPEG 2000 standard, but in general a codec will try to build layers in such a way that the image quality will increase monotonically with each layer, and the image distortion will shrink from layer to layer. Thus, layers define the progression by image quality within the codestream.

The problem is now to find the optimal packet length for all code-blocks which minimizes the overall distortion in a way that the generated target bitrate equals the demanded bitrate. While the standard does not define a procedure as to how to perform this so-called rate-distortion optimization, the general outline is given in one of its many appendices: For each bit encoded by the EBCOT coder, the improvement in image quality, defined as mean square error, gets measured; this can be implemented by an easy table-lookup algorithm. Furthermore, the length of the resulting codestream gets measured. This forms for each codeblock a graph in the rate-distortion plane, giving image quality over bitstream length. The optimal selection for the truncation points, thus for the packet-build-up points is then given by defining critical slopes of these curves, and picking all those coding passes whose curve in the rate-distortion graph is steeper than the given critical slope. This method can be seen as a special application of the method of Lagrange multiplier which is used for optimization problems under constraints. The Lagrange multiplier, typically denoted by λ, turns out to be the critical slope, the constraint is the demanded target bitrate, and the value to optimize is the overall distortion.

Packets can be reordered almost arbitrarily in the JPEG 2000 bit-stream; this gives the encoder as well as image servers a high degree of freedom.

Already encoded images can be sent over networks with arbitrary bit-rates by using a layer-progressive encoding order. On the other hand, color components can be moved back in the bit-stream; lower resolutions (corresponding to low-frequency sub-bands) could be sent first for image previewing. Finally, spatial browsing of large images is possible through appropriate tile- and/or partition selection. All these operations do not require any re-encoding but only byte-wise copy operations.

JPEG 2000 gains up to about 20% compression performance for medium compression rates in comparison to the first JPEG standard. For lower or higher compression rates, the improvement can be somewhat greater (especially if altering the input resolution to the codec is not considered as a technique for effective use of the older JPEG standard). Good applications for JPEG 2000 are large images, images with low-contrast edges — e.g. medical images.

It has, however, notably higher computational and memory demands.

Lossless compression is achieved through the use of a rounded version of the biorthogonal CDF 5/3 wavelet transform (instead of the biorthogonal CDF 9/7 transform) and a quantization step size of 1. Clearly, in lossless mode all bitplanes have to be encoded by the EBCOT, and no bitplanes can be dropped.

[edit] File format and Codestream

Similar to JPEG-1, JPEG2000 defines both a file format and a code-stream. Whereas the latter entirely describes the image samples, the former includes additional meta-information as the resolution of the image or the color space that has been used to encode the image. JPEG2000 images should - if stored as files - be boxed in the JPEG2000 file format, where they get the .jp2 extender. The part-2 extension to JPEG2000, i.e. ISO/IEC 15444-2, also enriches this file format by including mechanisms for animation or composition of several codestreams into one single image. Images in this extended file-format use the .jpx extender.

There is no standardized extender for code-stream data because codestream-data is not to be considered to be stored in files in first place, though when done for testing purposes, the extender .jpc or .j2k appear frequently.

[edit] Applications of JPEG 2000

The markets and applications better served by this standard are listed below:

  • Consumer applications such as multimedia devices (e.g., digital cameras, personal digital assistants, 3G mobile phones, color facsimile, printers, scanners etc)
  • Client/server communication (e.g., the internet, Image datebase, Video streaming, video server, etc.)
  • Military/surveillance (e.g HD satellite images, Motion detection, network distribution and storage, etc..)
  • Medical imagery, esp. the DICOM specifications for medical data interchange.
  • Storage of motion sequences, e.g. the Digital Cinema Initiatives consisting of a consortium of most major film studios and vendors picked JPEG2000 for storage and transmission of digital movies.
  • Remote sensing, digital libraries/archives, and E-commerce.

JPEG2000 is the image storage format used within Second Life.

[edit] Design commonalities with the ICER compressor

JPEG 2000 has some design commonalities with the ICER image compression format that is used to send images back from the Mars rovers.

The ICER image compressor was designed to meet the specialized needs of deep-space applications.

ICER (like JPEG 2000) is wavelet-based and provides

  • progressive compression.
  • lossless compression (using the LOCO compressor).
  • lossy compression.
  • image context error correction to limit the effects of data loss on the deep-space channel.

ICER overall provides lossy compression performance competitive with the JPEG 2000 image compression standard.

ICER-JPEG 2000 Common Features

  • Both offer a variable number of image tiles to increase compression effectiveness over the deep space channel. Image tiles reduce demands on memory and processing time.
  • Both offer a 'byte' quota.
  • Both offer a 'quality' quota (albeit ICER is subject to less than 1% overshoot when byte and quality quotas are in effect).

ICER-JPEG 2000 Differences

  • Lossless JPEG 2000 uses floating point or fixed-point math, ICER uses only integer math.
  • ICER reverts to a separate internal LOCO (Low Complexity Lossless Compression) compressor for lossless image compression.
  • JPEG 2000 implements a different lossless compressor concept by running its wavelet compressor in a lossless mode.
  • ICER and JPEG 2000 encode color spaces differently.
  • ICER in its current form compresses monochrome images better than colour images.

[edit] Legal issues

JPEG 2000 is not widely supported in present software due to the perceived danger of software patents on the mathematics of the compression method, this area of mathematics being heavily patented in general. JPEG 2000 is by itself not license-free, but the contributing companies and organizations agreed that licenses for its first part – the core coding system – can be obtained free of charge from all contributors.

The JPEG committee has stated:

It has always been a strong goal of the JPEG committee that its standards should be implementable in their baseline form without payment of royalty and license fees ... The up and coming JPEG 2000 standard has been prepared along these lines, and agreement reached with over 20 large organizations holding many patents in this area to allow use of their intellectual property in connection with the standard without payment of license fees or royalties. [1]

However, the JPEG committee has also noted that undeclared and obscure submarine patents may still present a hazard:

It is of course still possible that other organizations or individuals may claim intellectual property rights that affect implementation of the standard, and any implementers are urged to carry out their own searches and investigations in this area. [2]

Regardless, however, of the monetary cost of licensing JPEG2000 patents, it would still be impossible to comply with the Debian Free Software Guidelines (the acid test of software freedom) with freely-licensed patents unless the licenses were redistributable and irrevocable, even if the licensed application is modified. This alone could hamper adoption of JPEG 2000 for web purposes as it would exclude open-source web browsers (most notably Gecko-based browsers) and popular LAMP web applications.

[edit] Compression artifacts

Top-to-bottom demonstration of the artifacts of JPEG 2000 compression. The numbers indicate the compression ratio used. See the unscaled image for an accurate view.
Top-to-bottom demonstration of the artifacts of JPEG 2000 compression. The numbers indicate the compression ratio used. See the unscaled image for an accurate view.

The artifacts of JPEG 2000 look different from those of JPEG, have a slighter effect on the image and take higher compression levels to be visible. Often a photographic image can be compressed to 1/20 of its original (uncompressed bitmap) size without incurring visible artifacts. When the artifacts do appear, they can be seen as smoothing rather than squares or mosquito noise. The image to the right demonstrates the effects of JPEG 2000 compression in various ratios (the top image is the lossless original).

[edit] Comparison with PNG

Although JPEG 2000 format supports lossless encoding, it is not intended to completely supersede today's dominant lossless image file formats.

The PNG (Portable Network Graphics) format is still more space-efficient in the case of images with many pixels of the same color, and supports special compression features that JPEG 2000 does not.

It can be expected that PNG will be more heavily used for compressing diagram-type images and JPEG 2000 for photograph-type images, assuming no further changes to either standard.

[edit] References and Further Reading

[edit] Softwares and Tools links

  • JJ2000 Public Homepage
  • ECW — a wavelet compression format that compares well to JPEG 2000.
  • QuickTime - a multimedia framework, application and web browser plugin developed by Apple Computer, capable of encoding, decoding and playing various multimedia files (including JPEG2000 images by default).
  • IrfanView — Image viewer with read and limited write support for JPEG 2000.
  • XnView — Image viewer with support for JPEG 2000.
  • JasPer — A compression/decompression library, C language.
  • Pixel image editor — Image editor with internal support for JPEG 2000.
  • OpenJPEG — An open source (BSD) compression/decompression library, C language.
  • JPIP — The JPEG Internet Protocol, used for streamlining images using the JPEG 2000 format.
  • MrSID — a wavelet compression format that compares well to JPEG 2000
  • PAR GV - a multipurpose Java based Image and Video Viewer
  • Java ImageIO Tools 1.0_01 and 1.1 supports JPEG 2000
  • Apple's ImageIO — How any Mac OS X 10.4+ app can read and write JPEG2000.
  • OpenJPEG an open-source JPEG 2000 codec written in C language
  • PICTools — Low-level C libraries
  • Fnord — Free Photoshop plug-in
  • Apple Quicktime — Capable of reading; payment for registration code enables ability to write.
  • LizardTech GeoExpress — Capable of reading and writing JPEG 2000 and MrSID imagery
  • JPEG 2000 Compressor / Decompressor - Capable of reading and writing JPEG 2000 / NITF JPEG 2000 and a multitude of other Department of Defense Files
  • BOI software Coder/decoder and interactive viewer of JPEG2000, developed in JAVA under a free license.
  • intoPIX - JPEG2000 codecs on FPGA for Broadcast and Digital Cinema markets (including a DCI JPEG2000 decoder).
  • Kakadu Software - A JPEG2000 codec implementation by Dr. Taubman of University of New South Wales.
  • BroadMotion - JPEG2000 & Motion JPEG2000 codecs for embedded implementations, DSP and FPGA versions

JPEG 2000 comparisons: