JPEG-LS
   HOME

TheInfoList



OR:

Lossless JPEG is a 1993 addition to
JPEG JPEG ( ) is a commonly used method of lossy compression for digital images, particularly for those images produced by digital photography. The degree of compression can be adjusted, allowing a selectable tradeoff between storage size and imag ...
standard by the
Joint Photographic Experts Group The Joint Photographic Experts Group (JPEG) is the joint committee between ISO/IEC JTC 1/SC 29 and ITU-T Study Group 16 that created and maintains the JPEG, JPEG 2000, JPEG XR, JPEG XT, JPEG XS, JPEG XL, and related digital image standards. I ...
to enable
lossless compression Lossless compression is a class of data compression that allows the original data to be perfectly reconstructed from the compressed data with no loss of information. Lossless compression is possible because most real-world data exhibits statisti ...
. However, the term may also be used to refer to all lossless compression schemes developed by the group, including
JPEG 2000 JPEG 2000 (JP2) is an image compression standard and coding system. It was developed from 1997 to 2000 by a Joint Photographic Experts Group committee chaired by Touradj Ebrahimi (later the JPEG president), with the intention of superseding th ...
and JPEG-LS. Lossless JPEG was developed as a late addition to JPEG in 1993, using a completely different technique from the lossy JPEG standard. It uses a predictive scheme based on the three nearest (causal) neighbors (upper, left, and upper-left), and
entropy Entropy is a scientific concept, as well as a measurable physical property, that is most commonly associated with a state of disorder, randomness, or uncertainty. The term and the concept are used in diverse fields, from classical thermodyna ...
coding is used on the prediction error. The standard Independent JPEG Group libraries cannot encode or decode it, but Ken Murchison of Oceana Matrix Ltd. wrote a patch that extends the IJG library to handle lossless JPEG. Lossless JPEG has some popularity in medical imaging, and is used in DNG and some digital cameras to compress raw images, but otherwise was never widely adopted.
Adobe Adobe ( ; ) is a building material made from earth and organic materials. is Spanish for '' mudbrick''. In some English-speaking regions of Spanish heritage, such as the Southwestern United States, the term is used to refer to any kind of ...
'
DNG
SDK provides a software library for encoding and decoding lossless JPEG with up to 16 bits per sample. ISO/IEC Joint Photography Experts Group maintains a reference software implementation which can encode both base
JPEG JPEG ( ) is a commonly used method of lossy compression for digital images, particularly for those images produced by digital photography. The degree of compression can be adjusted, allowing a selectable tradeoff between storage size and imag ...
(ISO/IEC 10918-1 and 18477-1) and
JPEG XT JPEG XT (ISO/IEC 18477) is an image compression standard which specifies backward-compatible extensions of the base JPEG standard (ISO/IEC 10918-1 and ITU Rec. T.81). JPEG XT extends JPEG with support for higher integer bit depths, high dynami ...
extensions (ISO/IEC 18477 Parts 2 and 6-9), as well as JPEG-LS (ISO/IEC 14495).


Lossless mode of operation

Lossless JPEG is actually a mode of operation of JPEG. This mode exists because the discrete cosine transform (DCT) based form cannot guarantee that encoder input would exactly match decoder output. Unlike the lossy mode which is based on the DCT, the lossless coding process employs a simple predictive coding model called
differential pulse-code modulation Differential pulse-code modulation (DPCM) is a signal encoder that uses the baseline of pulse-code modulation (PCM) but adds some functionalities based on the prediction of the samples of the signal. The input can be an analog signal or a digital ...
(DPCM). This is a model in which predictions of the sample values are estimated from the neighboring samples that are already coded in the image. Most predictors take the average of the samples immediately above and to the left of the target sample. DPCM encodes the differences between the predicted samples instead of encoding each sample independently. The differences from one sample to the next are usually close to zero. A typical DPCM encoder is displayed in Fig.1. The block in the figure acts as a storage of the current sample which will later be a previous sample. The main steps of lossless operation mode are depicted in Fig.2. In the process, the predictor combines up to three neighboring samples at A, B, and C shown in Fig.3 in order to produce a prediction of the sample value at the position labeled by X. The three neighboring samples must be already encoded samples. Any one of the predictors shown in the table below can be used to estimate the sample located at X. Any one of the eight predictors listed in the table can be used. Note that selections 1, 2, and 3 are one-dimensional predictors and selections 4, 5, 6, and 7 are two-dimensional predictors. The first selection value in the table, zero, is only used for differential coding in the hierarchical mode of operation. Once all the samples are predicted, the differences between the samples can be obtained and entropy-coded in a lossless fashion using
Huffman coding In computer science and information theory, a Huffman code is a particular type of optimal prefix code that is commonly used for lossless data compression. The process of finding or using such a code proceeds by means of Huffman coding, an algo ...
or
arithmetic coding Arithmetic coding (AC) is a form of entropy encoding used in lossless data compression. Normally, a string of characters is represented using a fixed number of bits per character, as in the ASCII code. When a string is converted to arithmetic ...
. Typically, compressions using lossless operation mode can achieve around 2:1
compression ratio The compression ratio is the ratio between the volume of the cylinder and combustion chamber in an internal combustion engine at their maximum and minimum values. A fundamental specification for such engines, it is measured two ways: the stati ...
for color images. This mode is quite popular in the medical imaging field, and defined as an option in DNG standard, but otherwise it is not very widely used because of complexity of doing arithmetics on 10, 12 or 14bpp values on typical embedded 32-bit processor and a little resulting gain in space.


JPEG-LS


General description

JPEG-LS is a lossless/near-lossless compression standard for continuous-tone images. Its official designation is ISO-14495-1/ITU-T.87. It is a simple and efficient baseline algorithm which consists of two independent and distinct stages called modeling and encoding. JPEG-LS was developed with the aim of providing a low-complexity lossless and near-lossless image compression standard that could offer better compression efficiency than lossless JPEG. It was developed because at the time, the
Huffman coding In computer science and information theory, a Huffman code is a particular type of optimal prefix code that is commonly used for lossless data compression. The process of finding or using such a code proceeds by means of Huffman coding, an algo ...
-based JPEG lossless standard and other standards were limited in their compression performance. Total
decorrelation Decorrelation is a general term for any process that is used to reduce autocorrelation within a signal, or cross-correlation within a set of signals, while preserving other aspects of the signal. A frequently used method of decorrelation is the us ...
cannot be achieved by first order entropy of the prediction residuals employed by these inferior standards. JPEG-LS, on the other hand, can obtain good decorrelation. Part 1 of this standard was finalized in 1999. Part 2, released in 2003, introduced extensions such as
arithmetic coding Arithmetic coding (AC) is a form of entropy encoding used in lossless data compression. Normally, a string of characters is represented using a fixed number of bits per character, as in the ASCII code. When a string is converted to arithmetic ...
. The core of JPEG-LS is based on the LOCO-I algorithm, that relies on prediction, residual modeling and context-based coding of the residuals. Most of the low complexity of this technique comes from the assumption that prediction residuals follow a two-sided
geometric distribution In probability theory and statistics, the geometric distribution is either one of two discrete probability distributions: * The probability distribution of the number ''X'' of Bernoulli trials needed to get one success, supported on the set \; * ...
(also called a discrete
Laplace distribution In probability theory and statistics, the Laplace distribution is a continuous probability distribution named after Pierre-Simon Laplace. It is also sometimes called the double exponential distribution, because it can be thought of as two exponen ...
) and from the use of Golomb-like codes, which are known to be approximately optimal for geometric distributions. Besides lossless compression, JPEG-LS also provides a lossy mode ("near-lossless") where the maximum absolute error can be controlled by the encoder.


Performance

* Compression for JPEG-LS is generally much faster than JPEG 2000 and much better than the original lossless JPEG standard. * Compression for JPEG-LS is generally slightly worse than JPEG 2000, but this highly depends on the image content. * Decompression for JPEG-LS is generally much faster than JPEG 2000, but this depends on the exact software decoder implementations. ** This statement is valid for open-source implementations.


Application support

*
IrfanView IrfanView () is an image viewer, editor, organiser and converter program for Microsoft Windows. It can also play video and audio files, and has some image creation and painting capabilities. IrfanView is free for non-commercial use; commercial u ...
image viewer and editor has full read+write support for JPEG-LS image codec (.jls file extension). *
XnView XnView is an image organizer and general-purpose file manager used for viewing, converting, organizing and editing raster images, as well as general purpose file management. It comes with built-in hex inspection, batch renaming and screen ...
image viewer and editor claims the capability to read JPEG-LS (.jls) files. ** However, XnViewMP v0.98.1 can not read JPEG-LS files created by IrfanView v4.54.
CharLS
- an open-source JPEG-LS codec.
Thomas Richter's libjpeg
- an open-source JPEG-LS codec.




Hewlett-Packard JPEG-LS reference encoder v1.00
** Note: Direct link to file!


LOCO-I algorithm

Prior to encoding, there are two essential steps to be done in the modeling stage:
decorrelation Decorrelation is a general term for any process that is used to reduce autocorrelation within a signal, or cross-correlation within a set of signals, while preserving other aspects of the signal. A frequently used method of decorrelation is the us ...
(prediction) and
error modeling An error (from the Latin ''error'', meaning "wandering") is an action which is inaccurate or incorrect. In some usages, an error is synonymous with a mistake. The etymology derives from the Latin term 'errare', meaning 'to stray'. In statistic ...
.


Decorrelation/prediction

In the LOCO-I algorithm, primitive
edge detection Edge detection includes a variety of mathematical methods that aim at identifying edges, curves in a digital image at which the image brightness changes sharply or, more formally, has discontinuities. The same problem of finding discontinuitie ...
of horizontal or vertical edges is achieved by examining the neighboring pixels of the current pixel X as illustrated in Fig.3. The pixel labeled by B is used in the case of a vertical edge while the pixel located at A is used in the case of a horizontal edge. This simple predictor is called the
Median Edge Detection In statistics and probability theory, the median is the value separating the higher half from the lower half of a data sample, a population, or a probability distribution. For a data set, it may be thought of as "the middle" value. The basic fe ...
(MED) predictor or LOCO-I predictor. The pixel X is predicted by the LOCO-I predictor according to the following guesses: : X=\left\{ \begin{align} & \min (A,B)\quad \,\mbox{if}\,C\ge \max (A,B) \\ & \max (A,B)\quad \mbox{if}\,C\le \min (A,B) \\ & A+B-C\quad \,\mbox{otherwise}. \\ \end{align} \right. The three simple predictors are selected according to the following conditions: (1) it tends to pick B in cases where a vertical edge exists left of the X, (2) A in cases of an horizontal edge above X, or (3) A + B – C if no edge is detected.


Context modeling

The JPEG-LS algorithm estimates the conditional expectations of the prediction errors E\left\{ e, Ctx \right\} using corresponding sample means \bar{e}(C) within each context ''Ctx''. The purpose of context modeling is that the higher order structures like texture patterns and local activity of the image can be exploited by context modeling of the prediction error. Contexts are determined by obtaining the differences of the neighboring samples which represents the local
gradient In vector calculus, the gradient of a scalar-valued differentiable function of several variables is the vector field (or vector-valued function) \nabla f whose value at a point p is the "direction and rate of fastest increase". If the gr ...
: :\begin{align} & g_1 =D-B \\ & g_2 =B-C \\ & g_3 =C-A \end{align} The local gradient reflects the level of activities such as smoothness and edginess of the neighboring samples. Notice that these differences are closely related to the statistical behavior of prediction errors. Each one of the differences found in the above equation is then quantized into roughly equiprobable and connected regions. For JPEG-LS, the differences g1, g2, and g3 are quantized into 9 regions and the region are indexed from −4 to 4. The purpose of the quantization is to maximize the mutual information between the current sample value and its context such that the high-order dependencies can be captured. One can obtain the contexts based on the assumption that : P(e\mid Ctx= _1,q_2,q_3 = P(-e\mid Ctx= q_1,-q_2,-q_3 After merging contexts of both positive and negative signs, the total number of contexts is ((2\times 4+1)^3+1)/2=365 contexts. A bias estimation could be obtained by dividing cumulative prediction errors within each context by a count of context occurrences. In LOCO-I algorithm, this procedure is modified and improved such that the number of subtractions and additions are reduced. The division-free bias computation procedure is demonstrated i

Prediction refinement can then be done by applying these estimates in a feedback mechanism which eliminates prediction biases in different contexts.


Coding corrected prediction residuals

In the regular mode of JPEG-LS, the standard uses Golomb coding, Golomb–Rice codes which are a way to encode non-negative run lengths. Its special case with the optimal encoding value 2''k'' allows simpler encoding procedures.


Run length coding in uniform areas

Since Golomb–Rice codes are quite inefficient for encoding low entropy distributions because the coding rate is at least one bit per symbol, significant redundancy may be produced because the smooth regions in an image can be encoded at less than 1 bit per symbol. To avoid having excess code length over the entropy, one can use alphabet extension which codes blocks of symbols instead of coding individual symbols. This spreads out the excess coding length over many symbols. This is the “run” mode of JPEG-LS and it is executed once a flat or smooth context region characterized by zero gradients is detected. A run of west symbol “a” is expected and the end of run occurs when a new symbol occurs or the end of line is reached. The total run of length is encoded and the encoder would return to the “regular” mode.


JPEG 2000

JPEG 2000 includes a lossless mode based on a special integer
wavelet A wavelet is a wave-like oscillation with an amplitude that begins at zero, increases or decreases, and then returns to zero one or more times. Wavelets are termed a "brief oscillation". A taxonomy of wavelets has been established, based on the num ...
filter (biorthogonal 3/5). JPEG 2000's lossless mode runs more slowly and has often worse compression ratios than JPEG-LS on artificial and compound images but fares better than the UBC implementation of JPEG-LS on digital camera pictures. JPEG 2000 is also scalable, progressive, and more widely implemented.


JPEG XT

JPEG XT includes a lossless integer-to-integer DCT transform mode based on wavelet compression from JPEG 2000.


JPEG XL

JPEG XL includes a lossless/near-lossless/responsive mode called Modular which optionally uses a modified Haar transform (called "squeeze") and which is also used to encode the DC (1:8 scale) image in VarDCT mode as well as various auxiliary images such as adaptive quantization fields or additional channels like
alpha Alpha (uppercase , lowercase ; grc, ἄλφα, ''álpha'', or ell, άλφα, álfa) is the first letter of the Greek alphabet. In the system of Greek numerals, it has a value of one. Alpha is derived from the Phoenician letter aleph , whi ...
.


References


External links


JPEG 2000 still image coding versus other standardsJPEG2000, JPEG-LS and other lossless codecs on greyscale imagesLOCO-I home pageHP Labs LOCO-I/JPEG-LS home page
* ttps://stat.columbia.edu/~jakulin/jpeg-ls/ Links to Various Implementationsbr>Single-tone/grayscale JPEG-LS encoder algorithmEvaluation of JPEG-LS, IEEE TRANSACTIONS ON GEOSCIENCE AND REMOTE SENSING, VOL. 39, NO. 10, OCTOBER 2001
{{Graphics file formats
Lossless Lossless compression is a class of data compression that allows the original data to be perfectly reconstructed from the compressed data with no loss of information. Lossless compression is possible because most real-world data exhibits statistic ...
Graphics file formats Lossless compression algorithms Image compression