| dbpprop:abstract
|
- In computing, JPEG is a commonly used method of compression for photographic images. The degree of compression can be adjusted, allowing a selectable tradeoff between storage size and image quality. JPEG typically achieves 10:1 compression with little perceptible loss in image quality. JPEG compression is used in a number of image file formats. JPEG/Exif is the most common image format used by digital cameras and other photographic image capture devices; along with JPEG/JFIF, it is the most common format for storing and transmitting photographic images on the World Wide Web. These format variations are often not distinguished, and are simply called JPEG. The MIME media type for JPEG is image/jpeg. The JPEG standard The name "JPEG" stands for Joint Photographic Experts Group, the name of the committee that created the standard. The group was organized in 1986, issuing a standard in 1992, which was approved in 1994 as ISO 10918-1. The JPEG standard specifies both the codec, which defines how an image is compressed into a stream of bytes and decompressed back into an image, and the file format used to contain that stream. Typical usage The JPEG compression algorithm is at its best on photographs and paintings of realistic scenes with smooth variations of tone and color. For web usage, where the bandwidth used by an image is important, JPEG is very popular. JPEG/Exif is also the most common format saved by digital cameras. On the other hand, JPEG is not as well suited for line drawings and other textual or iconic graphics, where the sharp contrasts between adjacent pixels cause noticeable artifacts. Such images are better saved in a lossless graphics format such as TIFF, GIF, PNG, or a raw image format. JPEG is also not well suited to files that will undergo multiple edits, as some image quality will usually be lost each time the image is decompressed and recompressed, particularly if the image is cropped or shifted, or if encoding parameters are changed – see digital generation loss for details. To avoid this, an image that is being modified or may be modified in the future can be saved in a lossless format such as PNG, and a copy exported as JPEG for distribution. As JPEG is a lossy compression method, which removes information from the image, it must not be used in astronomical or medical imaging or other purposes where the exact reproduction of the data is required. Lossless formats such as PNG must be used instead. JPEG compression The compression method is usually lossy, meaning that some original image information is lost and cannot be restored (possibly affecting image quality. ) There are variations on the standard baseline JPEG that are lossless; however, these are not widely supported. There is also an interlaced "Progressive JPEG" format, in which data is compressed in multiple passes of progressively higher detail. This is ideal for large images that will be displayed while downloading over a slow connection, allowing a reasonable preview after receiving only a portion of the data. However, progressive JPEGs are not as widely supported, and even some software which does support them (such as some versions of Internet Explorer) only displays the image once it has been completely downloaded. There are also many medical imaging systems that create and process 12-bit JPEG images. The 12-bit JPEG format has been part of the JPEG specification for some time, but again, this format is not as widely supported. Lossless editing A number of alterations to a JPEG image can be performed losslessly (that is, without recompression and the associated quality loss) as long as the image size is a multiple 1 MCU block (Minimum Coded Unit) (usually 16 pixels in both directions, for chroma subsampling). Utilities that implement this include jpegtran, with user interface Jpegcrop, and the JPG_TRANSFORM plugin to IrfanView. Blocks can be rotated in 90 degree increments, flipped in the horizontal, vertical and diagonal axes and moved about in the image. Not all blocks from the original image need to be used in the modified one. The top and left of a JPEG image must lie on a block boundary, but the bottom and right need not do so. This limits the possible lossless crop operations, and also what flips and rotates can be performed on an image whose edges do not lie on a block boundary for all channels. When using lossless cropping, if the bottom or right side of the crop region is not on a block boundary then the rest of the data from the partially used blocks will still be present in the cropped file and can be recovered relatively easily by anyone with a hex editor and an understanding of the format. It is also possible to transform between baseline and progressive formats without any loss of quality, since the only difference is the order in which the coefficients are placed in the file. JPEG files The file format is known as 'JPEG Interchange Format' (JIF), as specified in Annex B of the standard. However, this "pure" file format is rarely used, primarily because of the difficulty of programming encoders and decoders that fully implement all aspects of the standard and because of certain shortcomings of the standard: Color space definition Component sub-sampling registration Pixel aspect ratio definition Several additional standards have evolved to address these issues. The first of these, released in 1992, was JPEG File Interchange Format (or JFIF), followed in recent years by Exchangeable image file format (Exif) and ICC color profiles. There is some confusion between the original 'JPEG Interchange Format' (JIF) and the similarly titled 'JPEG File Interchange Format' (JFIF). In some ways JFIF is a cutdown version of the JIF standard in that it specifies certain constraints (such as standard color space), while in other ways it is an extension of JIF due to the standard Application Segment header. The documentation for the original JFIF standard states: JPEG File Interchange Format is a minimal file format which enables JPEG bitstreams to be exchanged between a wide variety of platforms and applications. This minimal format does not include any of the advanced features found in the TIFF JPEG specification or any application specific file format. Nor should it, for the only purpose of this simplified format is to allow the exchange of JPEG compressed images. Image files that employ JPEG compression are commonly called "JPEG files". Most image capture devices (such as digital cameras) and most image editing software programs that write to a "JPEG file" are actually creating a file in the JFIF and/or Exif format. Strictly speaking, the JFIF and Exif standards are incompatible because they each specify that their header appears first. In practice, most JPEG files in Exif format contain a small JFIF header that precedes the Exif header. This allows older readers to correctly handle the older format JFIF header, while newer readers also decode the following Exif header. JPEG file extensions The most common filename extensions for files employing JPEG compression are . jpg and . jpeg, though . jpe, . jfif and . jif are also used. It is also possible for JPEG data to be embedded in other file types - TIFF encoded files often embed a JPEG image as a thumbnail of the main image. Color profile Many JPEG files embed an ICC color profile. Commonly used color profiles include sRGB and Adobe RGB. Because these color spaces use a non-linear transformation, the dynamic range of an 8-bit JPEG file is about 11 stops. However, many applications are not able to deal with JPEG color profiles and simply ignore them. Syntax and structure A JPEG image consists of a sequence of segments, each beginning with a marker, each of which begins with a 0xFF byte followed by a byte indicating what kind of marker it is. Some markers consist of just those two bytes; others are followed by two bytes indicating the length of marker-specific payload data that follows. (The length includes the two bytes for the length, but not the two bytes for the marker. ) Some markers are followed by entropy-coded data; the length of such a marker does not include the entropy-coded data. Note that consecutive 0xFF bytes are used as fill bytes for padding purposes (see JPEG specification section B.1.2.3 for details). Within the entropy-coded data, after any 0xFF byte, a 0x00 byte is inserted by the encoder before the next byte, so that there does not appear to be a marker where none is intended, preventing framing errors. Decoders must skip this 0x00 byte. This technique, called byte stuffing, is only applied to the entropy-coded data, not to marker payload data. There are other Start Of Frame markers that introduce other kinds of JPEG. Since several vendors might use the same APPn marker type, application-specific markers often begin with a standard or vendor name (e.g. , "Exif" or "Adobe") or some other identifying string. At a restart marker, block-to-block predictor variables are reset, and the bitstream is synchronized to a byte boundary. Restart markers provide means for recovery after bitstream error, such as transmission over an unreliable network or file corruption. Since the runs of macroblocks between restart markers may be independently decoded, these runs may be decoded in parallel. JPEG codec example Although a JPEG file can be encoded in various ways, most commonly it is done with JFIF encoding. The encoding process consists of several steps: The representation of the colors in the image is converted from RGB to YCbCr, consisting of one luma component (Y), representing brightness, and two chroma components, (Cb and Cr), representing color. This step is sometimes skipped. The resolution of the chroma data is reduced, usually by a factor of 2. This reflects the fact that the eye is less sensitive to fine color details than to fine brightness details. The image is split into blocks of 8×8 pixels, and for each block, each of the Y, Cb, and Cr data undergoes a discrete cosine transform (DCT). A DCT is similar to a Fourier transform in the sense that it produces a kind of spatial frequency spectrum. The amplitudes of the frequency components are quantized. Human vision is much more sensitive to small variations in color or brightness over large areas than to the strength of high-frequency brightness variations. Therefore, the magnitudes of the high-frequency components are stored with a lower accuracy than the low-frequency components. The quality setting of the encoder (for example 50 or 95 on a scale of 0–100 in the Independent JPEG Group's library) affects to what extent the resolution of each frequency component is reduced. If an excessively low quality setting is used, the high-frequency components are discarded altogether. The resulting data for all 8×8 blocks is further compressed with a loss-less algorithm, a variant of Huffman encoding. The decoding process reverses these steps. In the remainder of this section, the encoding and decoding processes are described in more detail. Encoding Many of the options in the JPEG standard are not commonly used, and as mentioned above, most image software uses the simpler JFIF format when creating a JPEG file, which among other things specifies the encoding method. Here is a brief description of one of the more common methods of encoding when applied to an input that has 24 bits per pixel (eight each of red, green, and blue). This particular option is a lossy data compression method. Color space transformation First, the image should be converted from RGB into a different color space called YCbCr. It has three components Y, Cb and Cr: the Y component represents the brightness of a pixel, the Cb and Cr components represent the chrominance (split into blue and red components). This is the same color space as used by digital color television as well as digital video including video DVDs, and is similar to the way color is represented in analog PAL video and MAC but not by analog NTSC, which uses the YIQ color space. The YCbCr color space conversion allows greater compression without a significant effect on perceptual image quality (or greater perceptual image quality for the same compression). The compression is more efficient as the brightness information, which is more important to the eventual perceptual quality of the image, is confined to a single channel, more closely representing the human visual system. This conversion to YCbCr is specified in the JFIF standard, and should be performed for the resulting JPEG file to have maximum compatibility. However, some JPEG implementations in "highest quality" mode do not apply this step and instead keep the color information in the RGB color model, where the image is stored in separate channels for red, green and blue luminance. This results in less efficient compression, and would not likely be used if file size was an issue. Downsampling Due to the densities of color- and brightness-sensitive receptors in the human eye, humans can see considerably more fine detail in the brightness of an image (the Y component) than in the color of an image (the Cb and Cr components). Using this knowledge, encoders can be designed to compress images more efficiently. The transformation into the YCbCr color model enables the next step, which is to reduce the spatial resolution of the Cb and Cr components. The ratios at which the downsampling can be done on JPEG are 4:4:4 (no downsampling), 4:2:2 (reduce by factor of 2 in horizontal direction), and most commonly 4:2:0 (reduce by factor of 2 in horizontal and vertical directions). For the rest of the compression process, Y, Cb and Cr are processed separately and in a very similar manner. Block splitting After subsampling, each channel must be split into 8×8 blocks of pixels. Depending on chroma subsampling, this yields (Minimum Coded Unit) MCU blocks of size 8×8, 16×8, or most commonly 16×16 . If the data for a channel does not represent an integer number of blocks then the encoder must fill the remaining area of the incomplete blocks with some form of dummy data. Filling the edge pixels with a fixed color (typically black) creates ringing artifacts along the visible part of the border; repeating the edge pixels is a common technique that reduces the visible border, but it can still create artifacts. Discrete cosine transform Next, each component (Y, Cb, Cr) of each 8×8 block is converted to a frequency-domain representation, using a normalized, two-dimensional type-II discrete cosine transform (DCT). As an example, one such 8×8 8-bit subimage might be: \begin{bmatrix} \end{bmatrix} Before computing the DCT of the subimage, its gray values are shifted from a positive range to one centered around zero. For an 8-bit image each pixel has 256 possible values: <math>[0, 255]. To center around zero it is necessary to subtract by half the number of possible values, or 128. \frac{2^{bit}}{2} \frac{2^8}{2} 2^7 128 Subtracting 128 from each pixel value yields pixel values on <math>[-128, 127] \begin{array}{c} x \\ \longrightarrow \\ \begin{bmatrix} \end{bmatrix} \end{array} \Bigg\downarrow y The next step is to take the two-dimensional DCT, which is given by: \ G_{u,v} \alpha(u) \alpha(v) \sum_{x0}^7 \sum_{y0}^7 g_{x,y} \cos \left[\frac{\pi}{8} \left(x+\frac{1}{2}\right) u \right] \cos \left[\frac{\pi}{8} \left(y+\frac{1}{2}\right) v \right] where \ u is the horizontal spatial frequency, for the integers <math>\ 0 \leq u < 8. \ v is the vertical spatial frequency, for the integers <math>\ 0 \leq v < 8. \alpha_p(n) \begin{cases} \sqrt{ \frac{1}{8} }, & \mbox{if }n0 \\ \sqrt{ \frac{2}{8} }, & \mbox{otherwise} \end{cases} is a normalizing function \ g_{x,y} is the pixel value at coordinates <math>\ (x,y) \ G_{u,v} is the DCT coefficient at coordinates <math>\ (u,v) If we perform this transformation on our matrix above, and then round to the nearest integer, we get \begin{array}{c} u \\ \longrightarrow \\ \begin{bmatrix} \end{bmatrix} \end{array} \Bigg\downarrow v Note the rather large value of the top-left corner. This is the DC coefficient. The remaining 63 coefficients are called the AC coefficients. The advantage of the DCT is its tendency to aggregate most of the signal in one corner of the result, as may be seen above. The quantization step to follow accentuates this effect while simultaneously reducing the overall size of the DCT coefficients, resulting in a signal that is easy to compress efficiently in the entropy stage. The DCT temporarily increases the bit-depth of the image, since the DCT coefficients of an 8-bit/component image take up to 11 or more bits (depending on fidelity of the DCT calculation) to store. This may force the codec to temporarily use 16-bit bins to hold these coefficients, doubling the size of the image representation at this point; they are typically reduced back to 8-bit values by the quantization step. The temporary increase in size at this stage is not a performance concern for most JPEG implementations, because typically only a very small part of the image is stored in full DCT form at any given time during the image encoding or decoding process. Quantization The human eye is good at seeing small differences in brightness over a relatively large area, but not so good at distinguishing the exact strength of a high frequency brightness variation. This allows one to greatly reduce the amount of information in the high frequency components. This is done by simply dividing each component in the frequency domain by a constant for that component, and then rounding to the nearest integer. This is the main lossy operation in the whole process. As a result of this, it is typically the case that many of the higher frequency components are rounded to zero, and many of the rest become small positive or negative numbers, which take many fewer bits to store. A typical quantization matrix, as specified in the original JPEG Standard, is as follows: \begin{bmatrix} \end{bmatrix} The quantized DCT coefficients are computed with B_{j,k} \mathrm{round} \left(\frac{G_{j,k}}{Q_{j,k}} \right) \mbox{ for } j0,1,2,\cdots,N_1-1; k0,1,2,\cdots,N_2-1 where <math>G is the unquantized DCT coefficients; <math>Q is the quantization matrix above; and <math>B is the quantized DCT coefficients. (Note that this is in no way matrix multiplication. ) Using this quantization matrix with the DCT coefficient matrix from above results in: \begin{bmatrix} \end{bmatrix} For example, using −415 (the DC coefficient) and rounding to the nearest integer \mathrm{round} \left(\frac{-415}{16} \right) \mathrm{round} \left(\right) Entropy coding Entropy coding is a special form of lossless data compression. It involves arranging the image components in a "zigzag" order employing run-length encoding (RLE) algorithm that groups similar frequencies together, inserting length coding zeros, and then using Huffman coding on what is left. The JPEG standard also allows, but does not require, the use of arithmetic coding, which is mathematically superior to Huffman coding. However, this feature is rarely used as it is covered by patents and because it is much slower to encode and decode compared to Huffman coding. Arithmetic coding typically makes files about 5% smaller. The zigzag sequence for the above quantized coefficients are shown below. (The format shown is just for ease of understanding/viewing. ) If the i-th block is represented by Bi and positions within each block are represented by (p,q) where p 0, 1, ... , 7 and q 0, 1, ... , 7, then any coefficient in the DCT image can be represented as Bi(p,q). Thus, in the above scheme, the order of encoding pixels (for the i-th block) is Bi(0,0), Bi(0,1), Bi(1,0), Bi(2,0), Bi(1,1), Bi(0,2), Bi(0,3), Bi(1,2) and so on. This encoding mode is called baseline sequential encoding. Baseline JPEG also supports progressive encoding. While sequential encoding encodes coefficients of a single block at a time (in a zigzag manner), progressive encoding encodes similar-positioned coefficients of all blocks in one go, followed by the next positioned coefficients of all blocks, and so on. So, if the image is divided into N 8×8 blocks {B0,B1,B2, ... , Bn-1}, then progressive encoding encodes Bi(0,0) for all blocks, i.e. , for all i 0, 1, 2, ... , N-1. This is followed by encoding Bi(0,1) coefficient of all blocks, followed by Bi(1,0)-th coefficient of all blocks, then Bi(2,0)-th coefficient of all blocks, and so on. It should be noted here that once all similar-positioned coefficients have been encoded, the next position to be encoded is the one occurring next in the zigzag traversal as indicated in the figure above. It has been found that Baseline Progressive JPEG encoding usually gives better compression as compared to Baseline Sequential JPEG due to the ability to use different Huffman tables (see below) tailored for different frequencies on each "scan" or "pass" (which includes similar-positioned coefficients), though the difference is not too large. In the rest of the article, it is assumed that the coefficient pattern generated is due to sequential mode. In order to encode the above generated coefficient pattern, JPEG uses Huffman encoding. JPEG has a special Huffman code word for ending the sequence prematurely when the remaining coefficients are zero. Using this special code word: "EOB", the sequence becomes: JPEG's other code words represent combinations of (a) the number of significant bits of a coefficient, including sign, and (b) the number of consecutive zero coefficients that precede it. (Once you know how many bits to expect, it takes 1 bit to represent the choices {-1, +1}, 2 bits to represent the choices {-3, -2, +2, +3}, and so forth. ) In our example block, most of the quantized coefficients are small numbers that are not preceded immediately by a zero coefficient. These more-frequent cases will be represented by shorter code words. The JPEG standard provides general-purpose Huffman tables; encoders may also choose to generate Huffman tables optimized for the actual frequency distributions in images being encoded. Compression ratio and artifacts The resulting compression ratio can be varied according to need by being more or less aggressive in the divisors used in the quantization phase. Ten to one compression usually results in an image that cannot be distinguished by eye from the original. 100 to one compression is usually possible, but will look distinctly artifacted compared to the original. The appropriate level of compression depends on the use to which the image will be put. Those who use the World Wide Web may be familiar with the irregularities known as compression artifacts (commonly known as 'jaggies') that appear in JPEG images. These are due to the quantization step of the JPEG algorithm. They are especially noticeable around sharp corners between contrasting colours (text is a good example as it contains many such corners). They can be reduced by choosing a lower level of compression; they may be eliminated by saving an image using a lossless file format, though for photographic images this will usually result in a larger file size. The images created with ray-tracing programs have noticeable blocky shapes on the terrain. Compression artifacts are acceptable when the images are used for visualization purpose. Unfortunately subsequent processing of these images usually result in unacceptable artifacts. Some programs allow the user to vary the amount by which individual blocks are compressed. Stronger compression is applied to areas of the image that show fewer artifacts. This way it is possible to manually reduce JPEG file size with less loss of quality. Since the quantization stage always results in a loss of information, JPEG standard is always a lossy compression codec. (Information is lost both in quantizing and rounding of the floating-point numbers. ) Even if the quantization matrix is a matrix of ones, information will still be lost in the rounding step. Decoding Decoding to display the image consists of doing all the above in reverse. Taking the DCT coefficient matrix (after adding the difference of the DC coefficient back in) \begin{bmatrix} \end{bmatrix} and taking the entry-for-entry product with the quantization matrix from above results in \begin{bmatrix} \end{bmatrix} which closely resembles the original DCT coefficient matrix for the top-left portion. Taking the inverse DCT (type-III DCT) results in an image with values (still shifted down by 128) \begin{bmatrix} \end{bmatrix} and adding 128 to each entry \begin{bmatrix} \end{bmatrix} This is the uncompressed subimage and can be compared to the original subimage (also see images to the right) by taking the difference (original − uncompressed) results in error values \begin{bmatrix} \end{bmatrix} with an average absolute error of about 5 values per pixels (i.e. , <math>\frac{1}{64} \sum_{x1}^8 \sum_{y1}^8 |e| 4.8125). The error is most noticeable in the bottom-left corner where the bottom-left pixel becomes darker than the pixel to its immediate right. Required precision The JPEG encoding does not fix the precision needed for the output compressed image. On the contrary, the JPEG standard (as well as the derived MPEG standards) have very strict precision requirements for the decoding, including all parts of the decoding process (variable length decoding, inverse DCT, dequantization, renormalization of outputs); the output from the reference algorithm must not exceed: a maximum 1 bit of difference for each pixel component low mean square error over each 8×8-pixel block very low mean error over each 8×8-pixel block very low mean square error over the whole image extremely low mean error over the whole image These assertions are tested on a large set of randomized input images, to handle the worst cases. Look at the IEEE 1180-1990 standard for reference. This has a consequence on the implementation of decoders, and it is extremely critical because some encoding processes (notably used for encoding sequences of images like MPEG) need to be able to construct, on the encoder side, a reference decoded image. In order to support 8-bit precision per pixel component output, dequantization and inverse DCT transforms are typically implemented with at least 14-bit precision in optimized decoders. Effects of JPEG compression JPEG compression artifacts blend well into photographs with detailed non-uniform textures, allowing higher compression ratios. Notice how a higher compression ratio first affects the high-frequency textures in the upper-left corner of the image, and how the contrasting lines become more fuzzy. The very high compression ratio severely affects the quality of the image, although the overall colors and image form are still recognizable. However, the precision of colors suffer less (for a human eye) than the precision of contours (based on luminance). This justifies the fact that images should be first transformed in a color model separating the luminance from the chromatic information, before subsampling the chromatic planes (which may also use lower quality quantization) in order to preserve the precision of the luminance plane with more information bits. Sample photographs For information, the uncompressed 24-bit RGB bitmap image below (73,242 pixels) would require 219,726 bytes (excluding all other information headers). The filesizes indicated below include the internal JPEG information headers and some meta-data. For full quality images (Q100), about 8.25 bits per color pixel is required. On grayscale images, a minimum of 6.5 bits per pixel is enough (a comparable Q100 quality color information requires about 25% more encoded bits). The full quality image below (Q100) is encoded at 9 bits per color pixel, the medium quality image (Q25) uses 1 bit per color pixel. For most applications, the quality factor should not go below 0.75 bit per pixel (Q12.5), as demonstrated by the low quality image. The image at lowest quality uses only 0.13 bit per pixel, and displays very poor color, it could only be usable after subsampling to a much lower display size. The medium quality photo uses only 4.3% of the storage space but has little noticeable loss of detail or visible artifacts. However, once a certain threshold of compression is passed, compressed images show increasingly visible defects. See the article on rate distortion theory for a mathematical explanation of this threshold effect. Lossless further compression From 2004 to 2008, new research has emerged on ways to further compress the data contained in JPEG images without modifying the represented image. This has applications in scenarios where the original image is only available in JPEG format, and its size needs to be reduced for archival or transmission. Standard general-purpose compression tools cannot significantly compress JPEG files. Typically, such schemes take advantage of improvements to the naive scheme for coding DCT coefficients, which fails to take into account: Correlations between magnitudes of adjacent coefficients in the same block; Correlations between magnitudes of the same coefficient in adjacent blocks; Correlations between magnitudes of the same coefficient/block in different channels; The DC coefficients when taken together resemble a downscale version of the original image multiplied by a scaling factor. Well-known schemes for lossless coding of continuous-tone images can be applied, achieving somewhat better compression than the Huffman coded DPCM used in JPEG. Some standard but rarely-used options already exist in JPEG to improve the efficiency of coding DCT coefficients: the arithmetic coding option, and the progressive coding option (which produces lower bitrates because values for each coefficient are coded independently, and each coefficient has a significantly different distribution). Modern methods have improved on these techniques by reordering coefficients to group coefficients of larger magnitude together; using adjacent coefficients and blocks to predict new coefficient values; dividing blocks or coefficients up among a small number of independently coded models based on their statistics and adjacent values; and most recently, by decoding blocks, predicting subsequent blocks in the spatial domain, and then encoding these to generate predictions for DCT coefficients. Typically, such methods can compress existing JPEG files between 15 and 25 percent, and for JPEGs compressed at low-quality settings, can produce improvements of up to 65%. A freely-available tool called packJPG is based on the 2007 paper "Improved Redundancy Reduction for JPEG Files. " There are also at least two companies selling proprietary tools with similar capabilities, Infima's JPACK and Smith Micro Software's StuffIt, both of which claim to have pending patents on their respective technologies. Derived formats JPEG Stereoscopic (JPS, extension . jps) is a JPEG-based format for stereoscopic images. It contains two images of identical size side by side, one for each eye. JPEG Multi-Picture Format (MPO, extension . mpo) is a JPEG-based format for multi-view images. It contains two or more images. Patent issues In 2002 Forgent Networks asserted that it owned and would enforce patent rights on the JPEG technology, arising from a patent that had been filed on October 27, 1986, and granted on October 6, 1987. The announcement created a furor reminiscent of Unisys' attempts to assert its rights over the GIF image compression standard. The JPEG committee investigated the patent claims in 2002 and were of the opinion that they were invalidated by prior art. Others also concluded that Forgent did not have a patent that covered JPEG. Nevertheless, between 2002 and 2004 Forgent was able to obtain about US$105 million by licensing their patent to some 30 companies. In April 2004, Forgent sued 31 other companies to enforce further license payments. In July of the same year, a consortium of 21 large computer companies filed a countersuit, with the goal of invalidating the patent. In addition, Microsoft launched a separate lawsuit against Forgent in April 2005. In February 2006, the United States Patent and Trademark Office agreed to re-examine Forgent's JPEG patent at the request of the Public Patent Foundation. On May 26, 2006 the USPTO found the patent invalid based on prior art. The USPTO also found that Forgent knew about the prior art, and did not tell the Patent Office, making any appeal to reinstate the patent highly unlikely to succeed. Forgent also possesses a similar patent granted by the European Patent Office in 1994, though it is unclear how enforceable it is. As of October 27, 2006, the U.S. patent's 20-year term appears to have expired, and in November 2006, Forgent agreed to abandon enforcement of patent claims against use of the JPEG standard. The JPEG committee has as one of its explicit goals that their standards (in particular their baseline methods) be implementable without payment of license fees, and they have secured appropriate license rights for their upcoming JPEG 2000 standard from over 20 large organizations. Beginning in August 2007, another company, Global Patent Holdings, LLC claimed that its patent, is infringed by the downloading of JPEG images on either a website or through e-mail. If not invalidated, this patent could apply to any website that displays JPEG images. The patent emerged in July 2007 following a seven-year reexamination by the U.S. Patent and Trademark Office in which all of the original claims of the patent were revoked, but an additional claim (claim 17) was confirmed. In its first two lawsuits following the reexamination, both filed in Chicago, Illinois, Global Patent Holdings sued the Green Bay Packers, CDW, Motorola, Apple, Orbitz, Officemax, Caterpillar, Kraft and Peapod as defendants. A third lawsuit was filed on December 5, 2007 in Southern Florida against ADT Security Services, AutoNation, Florida Crystals Corp. , HearUSA, MovieTickets. com, Ocwen Financial Corp. and Tire Kingdom, and a fourth lawsuit on January 8, 2008 in Southern Florida against the Boca Raton Resort & Club. A fifth lawsuit was filed against Global Patent Holdings in Nevada. That lawsuit was filed by Zappos. com, Inc. , who was allegedly threatened by Global Patent Holdings, and seeks a judicial declaration that the '341 patent is invalid and not infringed. The patent owner has also used the patent to sue or threaten outspoken critics of broad software patents, including Gregory Aharonian and the anonymous operator of a website blog known as the "Patent Troll Tracker. " On December 21, 2007, patent lawyer Vernon Francissen of Chicago asked the U.S. Patent and Trademark Office to reexamine the sole remaining claim of the '341 patent on the basis of new prior art. On March 5, 2008, the U.S. Patent and Trademark Office agreed to reexamine the '341 patent, finding that the new prior art raised substantial new questions regarding the patent's validity. In light of the reexamination, the accused infringers in four of the five pending lawsuits have filed motions to suspend (stay) their cases until completion of the U.S. Patent and Trademark Office's review of the '341 patent. On April 23, 2008, a judge presiding over the two lawsuits in Chicago, Illinois granted the motions in those cases. On July 22, 2008, the Patent Office issued the first "Office Action" of the second reexamination, finding the claim invalid based on nineteen separate grounds. Standards JPEG (lossy and lossless): ITU-T T.81, ISO/IEC IS 10918-1 JPEG (extensions): ITU-T T.84 JPEG-LS (lossless, improved): ITU-T T.87, ISO/IEC IS 14495-1 JBIG (black and white pictures): ITU-T T.82, ISO/IEC IS 11544-1 JPEG 2000 : ITU-T T.800, ISO/IEC IS 15444-1 JPEG-2000 (extensions): ITU-T T.801 JPEG XR (formerly called HD Photo) : ISO/IEC 29199-2 See also Image compression Image file formats Comparison of graphics file formats Windows Picture and Fax Viewer Exchangeable image file format (Exif) JPEG File Interchange Format (JFIF) Design rule for Camera File system (DCF) JPEG 2000 Motion JPEG Graphics editing program GDI+ vulnerability section of GDI article, exploitable bug in JPEG handling code of GDI+ library Comparison of layout engines (graphics) Generation loss PGF PNG Lossless Image Codec FELICS C-Cube an early implementer of JPEG in chip form Libjpeg of Independent JPEG Group Deblocking filter (video), the similar deblocking methods could be applied to JPEG Lenna, the traditional standard image used to test image processing algorithms References External links JPEG Standard (JPEG ISO/IEC 10918-1 ITU-T Recommendation T.81) at W3. org Official Joint Photographic Experts Group site JFIF File Format at W3. org Wotsit. org's entry on the JPEG format Example images over the full range of quantization levels from 1 to 100 at visengi. com
- JPEG ist die gebräuchliche Bezeichnung für die 1992 vorgestellte Norm ISO/IEC 109181 bzw. CCITT Recommendation T.81, die verschiedene Methoden der Bildkompression beschreibt. Die Bezeichnung „JPEG“ geht auf das Gremium Joint Photographic Experts Group zurück, das die JPEGNorm entwickelt hat. JPEG schlägt verschiedene Komprimierungs und Kodierungsmethoden vor, darunter verlustbehaftete und verlustfreie Komprimierung, verschiedene Farbtiefen sowie sequenzielle oder progressive Modi (normaler Bildaufbau bzw. allmähliche Verfeinerung). Weithin verbreitet ist nur die verlustbehaftete Komprimierung bei sequenziellem oder progressivem Modus und 8BitFarbkanälen. Die JPEGNorm beschreibt lediglich Bildkompressionsverfahren, legt aber nicht fest, wie die so entstandenen Daten gespeichert werden sollen. Gemeinhin werden mit „JPEGDateien“ oder „JPGDateien“ Dateien im Grafikformat JPEG File Interchange Format (JFIF) bezeichnet. JFIF ist jedoch nur eine Art, JPEGDaten abzulegen; SPIFF und JNG sind weitere, wenn auch wenig gebräuchliche, Möglichkeiten. Übersicht Die JPEGNorm ISO/IEC 109181 definiert folgende Modi, von denen nur die farbig unterlegten gebräuchlich sind: Zusätzlich zum in ISO/IEC 109181 definierten verlustbehafteten Modus gibt es noch die verbesserte, verlustfreie Komprimierungsmethode JPEGLS, die in einer anderen Norm festgelegt wurde. Außerdem existiert noch die JBIGNorm zur Komprimierung von Schwarzweißbildern. Die JPEGKomprimierung JPEGKompression ist in der Norm ITU T.81 definiert, die frei verfügbar ist und den offiziellen Titel Information technology – Digital compression and coding of continuoustone still images: Requirements and guidelines. trägt. Die Norm ist identisch mit ISO 109181 (die dort gegen Bezahlung bezogen werden kann). Das „Joint“ im Namen stammt von der Zusammenarbeit von ITU, IEC und ISO. Die Norm definiert 41 verschiedene Unterdateiformate, von denen aber meist nur eines unterstützt wird (und welches auch fast alle Anwendungsfälle abdeckt). Die Kompression erfolgt durch das Anwenden mehrerer Verarbeitungsschritte, von denen nur zwei verlustbehaftet sind. Farbraumumrechnung vom (meist) RGBFarbraum ins YCbCrFarbmodell (nach IEC 601). Tiefpassfilterung und Unterabtastung der Farbabweichungssignale Cb und Cr (verlustbehaftet). Einteilung in 8×8Blöcke und diskrete Kosinustransformation dieser Blöcke (theoretisch verlustfrei, durch Rundungsfehler aber verlustbehaftet). Quantisierung (verlustbehaftet). Umsortierung. Entropiekodierung. Die Datenreduktion erfolgt durch die verlustbehafteten Verarbeitungschritte in Zusammenwirken mit der Entropiekodierung. Kompressionen bis etwa 1,5...2 Bit/Pixel sind visuell verlustfrei, bei 0,7...1 Bit/Pixel sind noch gute Ergebnisse erzielbar, unter 0,3 Bit/Pixel wird JPEG praktisch unbrauchbar, das Bild wird zunehmend von unübersehbaren Kompressionsartefakten (Blockbildung, stufige Übergänge, Farbeffekte an Graukeilen) überdeckt. Der Nachfolger JPEG 2000 ist wesentlich weniger für diese Art von Artefakten anfällig. Sieht man als Quellformat 24BitRGBDateien an, erhält man Kompressionsraten von 12 bis 15 für visuell verlustfreie Bilder und bis zu 35 für noch gute Bilder. Die Qualität hängt aber neben der Kompressionrate noch von der Art der Bilder ab. Rauschen und regelmäßige feine Strukturen im Bild verringern die maximal mögliche Kompressionsrate. Der JPEG Lossless Mode zur verlustfreien Kompression verwendet ein anderes Verfahren. Farbraumumrechnung Das Ausgangsbild, welches meist als RGBBild vorliegt, wird in den YCbCrFarbraum umgerechnet. Grundsätzlich wird dabei das YPbPrSchema nach CCIR 601 verwendet: \begin{bmatrix} Y' Pb Pr \end{bmatrix} \approx \begin{bmatrix} 0{,}299 & 0{,}587 & 0{,}114 0{,}5 & 0{,}418688 & 0{,}081312 \end{bmatrix} \cdot \begin{bmatrix} R' G' B' \end{bmatrix} Da die R'G'B'Werte bereits digital als 8bitZahlen im Bereich {0, 1, ... , 255} vorliegen, müssen die YPbPrKomponenten lediglich verschoben (renormiert) werden, wodurch die Komponenten Y' (Luminanz), Cb (color blueness) und Cr (color redness) entstehen: \begin{bmatrix} Y' Cb Cr \end{bmatrix} \approx \begin{bmatrix} 0 128 128 \end{bmatrix} \begin{bmatrix} 0{,}299 & 0{,}587 & 0{,}114 0{,}5 & 0{,}418688 & 0{,}081312 \end{bmatrix} \cdot \begin{bmatrix} R'_d G'_d B'_d \end{bmatrix} Die Komponenten liegen nun wiederum im Wertebereich {0, 1, ... , 255}. Bei der Umrechnung des Farbraums entstehen die üblichen Rundungsfehler durch begrenzte Rechengenauigkeit, aber noch keine Datenreduktion (Qualitätsverluste). Tiefpassfilterung der Farbdifferenzsignale Die Farbabweichungssignale Cb und Cr werden meist in reduzierter Auflösung gespeichert. Dazu werden sie tiefpassgefiltert und unterabgetastet (im einfachsten Fall durch eine Mittelwertbildung). Meist wird eine vertikale und horizontale Unterabtastung jeweils um den Faktor 2 verwendet, die die Datenmenge um den Faktor 2 reduziert. Bei dieser Umwandlung wird die Tatsache ausgenutzt, dass die Ortsauflösung des menschlichen Auges für Farben deutlich geringer ist als für Helligkeitsübergänge. Blockbildung und diskrete Kosinustransformation Jede Komponente (Y, Cb und Cr) des Bildes wird in 8×8Blöcke eingeteilt. Diese werden einer zweidimensionalen diskreten Kosinustransformation (DCT) unterzogen: F_{xy} {1 \over 4} C_x C_y \sum_{m0}^7 \sum_{n0}^7 f_{mn} \cos \left[ \frac{(2m 1) x \pi}{16} \right] \cos \left[ \frac{(2n 1) y \pi}{16} \right] mit C_x, C_y \begin{cases} {1 \over \sqrt{2}} & \text{wenn }x, y 0 1 & \text{sonst } \end{cases} Diese Transformation lässt sich unter Nutzung der schnellen FourierTransformation (FFT) mit sehr wenig Aufwand implementieren. Die DCT ist eine orthonormale Transformation, weist gute Energiekompressioneigenschaften auf und es gibt eine inverse Transformation, die IDCT (was auch bedeutet, dass die DCT verlustfrei ist, es gingen keine Informationen verloren, da die Daten lediglich in eine für die weitere Verarbeitung günstigere Form gebracht wurden). Quantisierung Wie bei allen verlustbehafteten Kodierungsverfahren wird die eigentliche Datenreduktion (und Qualitätsverschlechterung) durch eine Quantisierung erreicht. Dazu werden die DCTKoeffizienten durch die Quantisierungsmatrix geteilt (elementweise dividiert) und danach auf die nächstliegende Ganzzahl abgerundet: F^Q(x,y) \left\lfloor \frac{F(x,y)}{Q(x,y)} \right\rfloor Bei diesem Rundungsschritt findet eine Irrelevanzreduktion statt. Die Quantisierungsmatrix ist sowohl für die Qualität, als auch für die Kompressionsrate verantwortlich. Sie ist in JPEGDateien im Header abgespeichert (DQTMarker). Optimal ist die Quantisierungsmatrix, wenn sie in etwa die Empfindlichkeit des Auges für die entsprechenden Ortsfrequenzen repräsentiert. Für grobe Strukturen ist das Auge empfindlicher, daher sind die Quantisierungswerte für diese Frequenzen kleiner als die für hohe Frequenzen. Hier ein Beispiel für eine Quantisierungsmatrix und ihre Anwendung auf einen 8×8Block aus DCTKoeffizienten: \begin{alignat}{2} Q & \begin{bmatrix} \end{bmatrix} F & \begin{bmatrix} 782{,}91 & 44{,}93 & 172{,}52 & 35{,}28 & 20{,}58 & 35{,}93 & 2{,}88 & 3{,}85 122{,}35 & 75{,}46 & 7{,}52 & 55{,}00 & 30{,}72 & 17{,}73 & 8{,}29 & 1{,}97 2{,}99 & 32{,}77 & 57{,}18 & 30{,}07 & 1{,}76 & 17{,}63 & 12{,}23 & 13{,}57 7{,}98 & 0{,}66 & 2{,}41 & 21{,}28 & 31{,}07 & 17{,}20 & 9{,}68 & 16{,}94 3{,}87 & 7{,}07 & 0{,}56 & 5{,}13 & 2{,}47 & 15{,}09 & 17{,}70 & 3{,}76 3{,}77 & 0{,}80 & 1{,}46 & 3{,}50 & 1{,}48 & 4{,}13 & 6{,}32 & 18{,}47 1{,}78 & 3{,}28 & 4{,}63 & 3{,}27 & 2{,}39 & 2{,}31 & 5{,}21 & 11{,}77 \end{bmatrix} F^Q & \begin{bmatrix} 78 & 3 & 7 & 1 & 0 & 1 & 0 & 0 8 & 4 & 0 & 1 & 1 & 0 & 0 & 0 0 & 1 & 2 & 1 & 0 & 0 & 0 & 0 \end{bmatrix} \end{alignat} Umsortierung und Differenzkodierung des Gleichstromanteils Die 64 Koeffizienten der diskreten CosinusTransformation werden anhand der Frequenz sortiert. Dadurch ergibt sich eine ZickZackförmige Reihenfolge, beginnend mit dem Gleichstromanteil mit der Frequenz 0. Nach dem englischen Direct Current wird er mit DC abgekürzt, hier bezeichnet er die mittlere Helligkeit. Die Koeffizienten mit hohem Wert stehen nun meist zuerst und kleine Koeffizienten weiter hinten. Dies optimiert die Eingabe der nachfolgenden Lauflängenkodierung. Die Umsortierreihenfolge sieht folgendermaßen aus: Weiterhin wird der Gleichstromanteil noch einmal differentiell zum Block links daneben kodiert und auf diese Weise die Abhängigkeiten zwischen benachbarten Blöcken berücksichtigt. Das obige Beispiel führt zu den folgenden umsortierten Koeffizienten Die Differenzkodierung des ersten Koeffizienten ergibt dann: In strukturarmen Regionen (desselben Bildes) können die Koeffizienten auch so aussehen: Diese Bereiche lassen sich natürlich besser als strukturreiche Gebiete kodieren. Beispielsweise durch eine Lauflängenkodierung. Die ZickZackUmsortierung der DCTKoeffizienten fällt zwar unter den Schutzbereich des USPatentes 4,698,672 (und weiterer Anmeldungen und Patente in Europa und Japan), jedoch wurde 2002 Stand der Technik gefunden, der das beanspruchte Verfahren offenbart, sodass die Ansprüche kaum durchsetzbar sind. Entropiekodierung Als Entropiekodierung wird meist eine HuffmanKodierung verwendet. Der JPEGStandard erlaubt auch eine arithmetische Kodierung. Obwohl diese zwischen 5 und 15 Prozent kleinere Dateien generiert, wird sie aus patentrechtlichen Gründen kaum verwendet, zudem ist diese Kodierung deutlich langsamer. Die JPEGDekodierung Die Dekompression (meist Dekodierung genannt) erfolgt invers zur Kompression: EntropieDekodierung Umsortierung Requantisierung Inverse Diskrete Kosinustransformation. Überabtastung und Tiefpassfilterung der Farbdifferenzsignal U und V (verlustbehaftet) Farbraumumrechnung vom YCbCrFarbraum in den Zielfarbraum (meist RGB) Die Dekompression ist zwar (weitgehend) verlustfrei, allerdings tritt das InverseDekoderProblem auf. Aus dekodierten Daten ist es nur schwierig möglich, die ursprüngliche Datei zu rekonstruieren. Ein DekodierKodierVorgang verändert die Datei und ist damit nicht verlustfrei, es treten wie beim analogen Überspielen Generationsverluste auf. Die Generationsverluste von JPEG sind allerdings vergleichsweise klein, wenn wieder die gleiche Quantisierungstabelle zum Einsatz kommt und die Blockgrenzen die gleichen sind. Bei geeigneten Randbedingungen kann man sie bei JPEG sogar vermeiden. Bei JPEG2000 ist das nicht mehr der Fall (überlappende Transformationen, wie sie bei JPEG2000 wie auch in der Audiodatenkompression zum Einsatz kommen, erfordern dafür utopische Rechenleistungen). Inverse diskrete Kosinustransformation Zur DCT existiert die inverse Transformation, die IDCT: f_{xy} {1 \over 4} \sum_{m0}^7 \sum_{n0}^7 C_m C_n F_{mn} \cos \left[ \frac{(2x 1) m \pi}{16} \right] \cos \left[ \frac{(2y 1) n \pi}{16} \right] mit den gleichen Korrekturfaktoren <math>C_k wie bei der DCT. Farbraumumrechnung Die Rückrechnung vom YCbCr in den RGBFarbraum erfolgt über die inverse Matrix der Hinrechnung, sie lautet: \begin{bmatrix}R' G' B'\end{bmatrix} \begin{bmatrix} 1 & 0 & 1{,}402 1 & 0{,}344136 & 0{,}714136 \end{bmatrix} \cdot \begin{bmatrix}Y' Pb Pr\end{bmatrix} mit: \begin{bmatrix} Y' Pb Pr \end{bmatrix} \begin{bmatrix} Y' Cb Cr \end{bmatrix} \begin{bmatrix} 0 128 128 \end{bmatrix} Progressives JPEG Ein JPEGBild besteht aus Koeffizienten. Diese speichern keine Pixel, sondern Annäherungen des gesamten Bildinhalts eines 8x8Bildblocks. Beim Progressive JPEG werden erst die ersten Koeffizienten jedes Bildblocks, dann die zweiten usw. der Reihe nach abgespeichert, so dass die Annäherung an das Originalbild immer besser wird. Wie beim Interlacing, das bei GIF angewendet wird, liegt der Zweck darin, dem Benutzer, noch bevor die gesamte Datei geladen ist, schnell ein grobes Vorschaubild zu geben. Dies ist besonders dann sinnvoll, wenn das Laden eines Bildes länger als eine halbe bis ganze Sekunde dauert bzw. man nur ein Vorschaubild benötigt. Jedoch werden große Bilder trotzdem meistens im normalen JPEG Modus zum Download angeboten. Verlustfreie Nachbearbeitung von JPEG Obwohl eine Dekodierung und Rekodierung meist verlustbehaftet ist, lassen sich einige Bildmanipulationen (prinzipiell) ohne unerwünschte Datenverluste durchführen: Bilddrehungen um 90°, 180° und 270° horizontale und vertikale Bildspiegelungen Beschneiden von Rändern um Vielfache von 16 Pixeln (bzw. 8 Pixel bei Schwarzweißbildern oder Farbbildern ohne Unterabtastung) Dazu ist die Entropiekodierung und die ZickZackUmsortierung rückgängig zu machen. Die Operationen erfolgen dann auf Grundlage der DCTKoeffizienten (umsortieren, weglassen nicht benötigter Blöcke). Danach erfolgt wieder die ZickZackUmsortierung und die Entropiekodierung. Wie man leicht sieht, erfolgen keine verlustbehafteten Arbeitsschritte mehr. Nicht jedes Programm führt diese Operationen verlustfrei durch, es muss dazu spezielle dateiformatspezifische Verarbeitungsmodule aufweisen. Bei den verbreiteten Bildbearbeitungsprogrammen ist das meist nicht der Fall, da diese in der Regel die Datei komplett dekodieren und dann mit diesen Daten arbeiten. Das für Windows und Linux verfügbare Konsolenprogramm jpegtran vermag es jedoch, alle diese Operationen verlustfrei auszuführen. Einschränkungen Bilder, deren Auflösung nicht ein Vielfaches von 16 Pixeln (bzw. 8 Pixel bei Schwarzweißbildern oder Farbbildern ohne Unterabtastung) beträgt, sind problematisch. Sie weisen unvollständige Blöcke auf, das heißt, Blöcke, die nicht alle synthetisierten Pixel verwenden. JPEG erlaubt solche Blöcke aber nur am rechten und am unteren Bildrand. Einige dieser Operationen verlangen daher einmalig, dass diese Randstreifen verworfen werden. Visuelle Qualität und verwandte Formate Die JPEGKompression ist für natürliche (Raster)Bilder entwickelt worden, wie man sie in der Fotografie oder bei computergenerierten Bildern vorfindet. Ungeeignet ist JPEG für digitale Strichzeichnungen (z. B. Screenshots oder Vektorgraphiken), die viele hochfrequente Bildteile (harte Kanten) enthalten, Schwarzweißbilder mit 1 Bit pro Bildpunkt, gerasterte Bilder (Zeitungsdruck). Für diese Bilder sind Formate wie GIF, PNG oder JBIG weitaus besser geeignet. Ein nachträgliches Heraufsetzen des Qualitätsfaktors vergrößert zwar den Speicherbedarf der Bilddatei, bringt aber verlorene Bildinformation nicht mehr zurück. Die Quantisierungstabellen können beliebig gewählt werden und sind nicht genormt. Viele Bildbearbeitungsprogramme lassen aber den Benutzer einen pauschalen Qualitätsfaktor zwischen 0 und 100 auswählen, der gemäß einer Formel in der vom JPEGKomitee herausgegebenen JPEGBibliothek in eine Quantisierungstabelle umgewandelt wird. Auch bei Qualitätsfaktoren wie „100“ oder „100 %“ findet immer noch eine Quantisierung und damit ein – bei für JPEG ungeeigneten Bildern erheblicher – Qualitätsverlust statt. Eine JPEGTransformation ist im Allgemeinen nicht idempotent. Das Öffnen und anschließende Speichern einer JPEGDatei führt zu einer neuen verlustbehafteten Kompression. Das Beispielbild vergleicht Aufnahmen, die mit unterschiedlichen Qualitätseinstellungen kodiert wurden. Die PortraitAufnahme besitzt eine Größe von 200×200 Pixeln. Bei 24 Bit Farbtiefe und unkomprimierter Speicherung erzeugt dieses Bild eine 120 Kbyte große Datei (exklusive Header und anderer MetaInformationen). Die Klötzchenbildung der 8×8 Pixel großen Quadrate stellt das rechte Teilbild vergrößert dar. Ein weiteres Problem neben der Klötzchenbildung ist das „Ringing“, eine Konsequenz des schlechten Verhaltens der DCT bei harten Farbübergängen. Für den ProfiBereich ist JPEG als Dateiformat wegen der verlustbehafteten Datenreduktion ungeeignet. Stattdessen werden Formate eingesetzt, die verlustfrei komprimieren, ungeachtet des großen Speicherbedarfs. Beispiele sind TIFF, BMP, TGA oder PNG (Vollfarbenmodus). Moderne Quellgeräte (Scanner, Digitale Kameras) erfassen mehr als 8 Bit pro Farbpixel. Bereits einfache Scanner arbeiten intern mit 12 Bit, erlauben aber nur die Speicherung von 8 Bit pro Farbpixel. Eine Profiaufnahme von 6 Megapixel erfordert bei einer Farbtiefe von 16 Bit pro Grundfarbe und 3 Grundfarben einen Speicherbedarf von 36 Mbyte, der sich bei strukturreichen, körnigen oder verrauschten Bildern durch verlustlose Kompression nur unwesentlich verkleinern lässt. Es ist möglich, die Komprimierung von JPEGDateien verlustfrei zu optimieren und somit die Dateigröße etwas zu verringern. Neuere Versionen einiger Packprogramme sind in der Lage, JPEGBilder verlustfrei um bis zu 25% zu komprimieren. Die Bewegtbildkompressionsverfahren MPEG1 und MPEG2 bauen auf dem JPEGStandard auf. Ein Nachfolgeprojekt von JPEG zur Speicherung von Bildern ist JPEG 2000, das über eine bessere Kompression und viele sinnvolle Eigenschaften verfügt, sich aber zumindest bis jetzt nicht in breitem Maße durchsetzen konnte. Ein weiteres potentielles Nachfolgeformat ist HD Photo, das von der Firma Microsoft entwickelt wurde. Es ist ebenfalls nur gering verbreitet, aber es befindet sich derzeit im Standardisierungsprozess unter dem Namen JPEG XR. Standards JPEG (verlustbehaftet und verlustfrei): ITUT T.81, ISO/IEC IS 109181 JPEG (Erweiterungen): ITUT T.84 JPEGLS (verlustfrei, verbessert): ITUT T.87, ISO/IEC IS 144951 JBIG (Schwarzweißbilder): ITUT T.82, ISO/IEC IS 115441 JPEG2000 (Nachfolger von JPEG und JPEGLS): ITUT T.800, ISO/IEC IS 154441 JPEG2000 (Erweiterungen): ITUT T.801 Siehe auch Motion JPEG (auch MJPEG oder MJPEG) Progressive Graphics File Literatur Heiner Küsters: Bilddatenkomprimierung mit JPEG und MPEG. Franzis, Poing 1995, ISBN 3772372813 Thomas W. Lipp: Grafikformate. Microsoft Press, Unterschleißheim 1997, ISBN 3860633910 John Miano: Compressed Image File Formats. AddisonWesley, Reading 2000, ISBN 0201604434 William Pennebaker, Joan Mitchell: JPEG Still Image Data Compression Standard. Chapman & Hall, New York 1993, ISBN 0442012721 Tilo Strutz: Bilddatenkompression. Vieweg, Wiesbaden 2005, ISBN 3528239220 Weblinks Offizielle JPEGWebsite Mathematik zur JPEGKompression faqs. org: Introduction to JPEG The Hitchhiker's Guide to JPEG Die freie Software JpegCrop kann JPEGs verlustfrei beschneiden. Programm jpegoptim für UnixSysteme (Englisch) Recommendation T.81 der ITU (Englisch, PDF; 1,01 MB) Quellenangaben
- JPEG és un algorisme dissenyat per a comprimir imatges estacionaries amb 24 bits de profunditat o en escala de grisos. El 1982 es va iniciar el grup JPEG al que s'uneix el SGVII el 1986. La primera versió del estàndard va ésser aprovada el 1991. El JPEG només tracta imatges fixes, però existeix un estàndard relacionat anomenat MPEG per a vídeo. De vegades se l'anomena incorrectament JPG a causa de l'extensió que té en sistemes operatius que només accepten tres lletres d'extensió. El JPEG és un Algorisme de compressió amb pèrdua. Això significa que en descomprimir la imatge no obtenim exactament la mateixa imatge que teníem abans de la compressió. Una de les característiques que fan molt flexible el JPEG és el poder ajustar el grau de compressió. Si especifiquem una compressió molt alta es perdrà una quantitat significativa de qualitat, però obtindrem fitxers extremadament petits. Amb una quantitat de compressió baixa obtenim una qualitat molt semblant a la de l'original, i un fitxer no tant petit. Aquesta pèrdua de qualitat s'acumula. Això significa que si comprimeix una imatge i la descomprimeix obtindrà una qualitat d'imatge, però si torna a comprimir-la i descomprimir-la altra vegada obtindrà una pèrdua major. Cada vegada que es comprimeix i descomprimeix la imatge aquesta perd una mica de qualitat. Així el JPEG inclou diversos procediments de compressió d'imatge i pot considerar-se com un conjunt d'eines per la compressió. Alguns esquemes del JPEG s'han fet molt populars i s'utilitzen en aplicacions informàtiques i d'electrònica de consum. Els mètodes proposats s'orienten a la codificació d'imatges multi-nivell tant monocromes com de color. Per la codificació d'imatges binàries existeix l'estàndard JBIG.
- JPEG (vyslovováno originálně džeipeg, ale užívá se též počeštěné výslovnosti jépeg nebo jpeg) je standardní metoda ztrátové komprese používané pro ukládání počítačových obrázků ve fotorealistické kvalitě. Formát souboru, který tuto kompresi používá, se také běžně nazývá JPEG. Nejrozšířenější příponou tohoto formátu je . jpg, . jpeg, . jfif, . jpe, nebo tato jména psána velkými písmeny. Skutečným názvem typu souboru je JFIF, což znamená JPEG File Interchange Format. Zkratka JPEG znamená Joint Photographic Experts Group, což je vlastně konsorcium, které tuto kompresi navrhlo. Když se běžně hovoří o souboru JPEG, míní se tím většinou soubor JFIF, nebo soubor Exif JPEG. Existuje však více formátů souborů založených na kompresi JPEG, například JNG. JPEG/JFIF je nejčastější formát používaný pro přenášení a ukládání fotografií na World Wide Webu. Není však vhodný pro perokresbu, zobrazení textu nebo ikonky, protože kompresní metoda JPEG vytváří v takovém obrazu viditelné a rušivé artefakty. Pro takové účely se většinou používají soubory PNG a GIF. Protože má GIF pouze 8 bitů na pixel, není vhodný pro barevné fotografie, PNG je možné použít pro ukládání fotografií, ale výsledná velikost souboru je nevhodná pro publikování na webu. MIME typ pro JFIF je image/jpeg (definované v RFC 1341).
- JPEG además de ser un método de compresión, es a menudo considerado como un formato de archivo. JPEG/Exif es el formato de imagen más común utilizado por las cámaras fotográficas digitales y otros dispositivos de captura de imagen, junto con JPEG/JFIF, que también es otro formato para el almacenamiento y la transmisión de imágenes fotográficas en la World Wide Web. JPEG/JFIF es el formato más utilizado para almacenar y transmitir archivos de fotos en Internet. Estas variaciones de formatos a menudo no se distinguen, y se llaman JPEG. El estándar JPEG "JPEG" significa "Joint Photographic Experts Group" (Junta del grupo de expertos en fotografía), nombre de la comisión que creó la norma, la cual fue integrada desde sus inicios por la fusión de varias agrupaciones en un intento de compartir y desarrollar su experiencia en la digitalización de imágenes. La ISO, tres años antes, había iniciado sus investigaciones en el área. Compresión del JPEG Es un algoritmo de compresión con pérdida. Esto significa que al descomprimir la imagen no obtenemos exactamente la misma imagen que teníamos antes de la compresión. Una de las características que hacen muy flexible el JPEG es el poder ajustar el grado de compresión. Si especificamos una compresión muy alta se perderá una cantidad significativa de calidad, pero obtendremos archivos de pequeño tamaño. Con una tasa de compresión baja obtenemos una calidad muy parecida a la del original, y un archivo mayor. Esta pérdida de calidad se acumula. Esto significa que si comprime una imagen y la descomprime obtendrá una calidad de imagen, pero si vuelve a comprimirla y descomprimirla otra vez obtendrá una pérdida mayor. Cada vez que comprima y descomprima la imagen, ésta perderá algo de calidad. La compresión con pérdida no es conveniente en imágenes o gráficos que tengan textos o líneas y sobre todo para archivos que contengan grandes áreas de colores sólidos. El algoritmo de compresión JPEG se basa en dos defectos visuales del ojo humano, uno es el hecho de que es mucho más sensible al cambio en la luminancia que en la crominancia, es decir, notamos más claramente los cambios de brillo que de color. El otro es que notamos con más facilidad pequeños cambios de brillo en zonas homogéneas que en zonas donde la variación es grande, por ejemplo en los bordes de los cuerpos de los objetos. Codificación Muchas de las opciones del estándar JPEG se usan poco. Esto es una descripción breve de uno de los muchos métodos usados comúnmente para comprimir imágenes cuando se aplican a una imagen de entrada con 24 bits por pixel (ocho por cada rojo, verde, y azul). Esta opción particular es un método de compresión con pérdida. Transformación del espacio de color Comienza convirtiendo la imagen desde su modelo de color RGB a otro llamado YUV ó YCbCr. Este espacio de color es similar al que usan los sistemas de color para televisión PAL y NTSC, pero es mucho más parecido al sistema de televisión MAC. Este espacio de color (YUV) tiene tres componentes: La componente Y, o Luminancia (información de brillo), es decir, la imagen en escala de grises. Las componentes U o Cb y V o Cr, respectivamente Saturación (la cantidad de blanco, o la pureza del color) y Tono (el nombre del color propiamente dicho, o la longitud de onda asociada); ambas señales son conocidas como crominancia (información de color). El resultado es una imagen en la que la luminancia está separada de la crominancia. Las ecuaciones que realizan éste cambio de base de RGB a YUV son las siguientes: Y 0.257 * R + 0.504 * G + 0.098 * B + 16 Cb U -0.148 * R - 0.291 * G + 0.439 * B + 128 Cr V 0.439 * R - 0.368 * G - 0.071 * B + 128 Las ecuaciones para el cambio inverso se pueden obtener despejando de las anteriores y se obtienen las siguientes: B 1.164 * (Y - 16) + 2.018 * (U - 128) G 1.164 * (Y - 16) - 0.813 * (V - 128) - 0.391 * (U - 128) R 1.164 * (Y - 16) + 1.596 * (V - 128) NOTA: Estas ecuaciones están en continua investigación, por lo que se pueden encontrar en libros y en la red otras ecuaciones distintas pero con coeficientes muy parecidos. Si se analiza el primer trío de ecuaciones veremos que las tres componentes toman como valor mínimo el 16. El canal de luminancia (canal Y) tiene como valor máximo el 235, mientras que los canales de crominancia el 240, todos estos valores caben en un byte haciendo redondeo al entero más próximo. Durante esta fase no hay pérdida de información. NOTA: Esta última afirmación no es del todo cierta ya que debido a los redondeos se introduce un pequeño margen de error aunque imperceptible para el ojo humano. Submuestreo Una opción que se puede aplicar al guardar la imagen, es reducir la información del color respecto a la de brillo (debido al defecto en el ojo humano comentado anteriormente). Hay varios métodos: si este paso no se aplica, la imagen sigue en su espacio de color YUV,, con lo que la imagen no sufre pérdidas. Puede reducirse la información cromática a la mitad, 4:2:2 (reducir en un factor de 2 en dirección horizontal), con lo que el color tiene la mitad de resolución (en horizontal), y el brillo sigue intacto. Otro método, muy usado, es reducir el color a la cuarta parte, 4:2:0, en el que el color se reduce en un factor de 2 en ambas direcciones, horizontal y vertical. Si la imagen de partida estaba en escala de grises (blanco y negro), puede eliminarse por completo la información de color, quedando como 4:0:0. Algunos programas que permiten el guardado de imágenes en JPEG (como el que usa GIMP) se refieren a estos métodos con 1×1,1×1,1×1 para YUV 4:4:4 (no perder color), 2×1,1×2,1×1 para YUV 4:2:2 y 2×2,1×1,1×1 para el último método, YUV 4:2:0. Las técnicas algorítmicas usadas para este paso (para su reconstrucción exactamente) suelen ser interpolación bilineal, vecino más próximo, convolución cúbica, Bezier, b-spline y Catmun-Roll. rh Transformación discreta de coseno o DCT Entonces, cada componente de la imagen se divide en pequeños bloques de 8×8 píxeles, que se procesan de forma casi independiente, de esto resulta la formación de los bloques, que se hace notable en imágenes guardadas con altas compresiones. Si la imagen sufrió un submuestreo del color, los colores quedarían en la imagen final en bloques de 8×16 y 16×16 pixeles, según fuese 4:2:2 o 4:2:0. Después cada pequeño bloque se convierte al dominio de la frecuencia a través de la transformación discreta de coseno bidimensional, abreviadamente llamada DCT. Un ejemplo de uno de esos pequeños bloques de 8×8 inicial es este: \begin{bmatrix} \end{bmatrix} El siguiente proceso es restarles 128 para que queden números entorno al 0, entre -128 y 127. \begin{bmatrix} \end{bmatrix} Se procede a la transformación por DCT de la matriz, y el redondeo de cada elemento al número entero más cercano. \begin{bmatrix} \end{bmatrix} Nótese que el elemento más grande de toda la matriz aparece en la esquina superior izquierda, este es el coeficiente DC. NOTA: Se ha comprobado que los resultados anteriormente expuestos están correctos. Cuantificación Como ya habíamos comentado, el ojo humano es muy bueno detectando pequeños cambios de brillo en áreas relativamente grandes, pero no cuando el brillo cambia rápidamente en pequeñas áreas (variación de alta frecuencia), esto permite eliminar las altas frecuencias, sin perder excesiva calidad visual. Esto se realiza dividiendo cada componente en el dominio de la frecuencia por una constante para ese componente, y redondeándolo a su número entero más cercano. Este es el proceso en el que se pierde la mayor parte de la información (y calidad) cuando una imagen es procesada por este algoritmo. El resultado de esto es que los componentes de las altas frecuencias, tienden a igualarse a cero, mientras que muchos de los demás, se convierten en números positivos y negativos pequeños. Una matriz de cuantificación típica es la matriz de Losheller que se usa opcionalmente en el estándar JPEG: \begin{bmatrix} \end{bmatrix} Dividiendo cada coeficiente de la matriz de la imagen transformada entre cada coeficiente de la matriz de cuantificación, se obtiene esta matriz, ya cuantificada: \begin{bmatrix} \end{bmatrix} Por ejemplo, cuantificando el primer elemento, el coeficiente DC, sería así: \mathrm{round} \left(\frac{-415}{16} \right) \mathrm{round} \left(\right) Codificación entrópica La codificación entrópica es una forma especial de la compresión sin pérdida de datos. Para ello se cogen los elementos de la matriz siguiendo una forma de zig-zag, poniendo grupos con frecuencias similares juntos, e insertando ceros de codificación, y usando la codificación Huffman para lo que queda. También se puede usar la codificación aritmética, superior a la de Huffman, pero que rara vez se usa, ya que está cubierta por patentes, esta compresión produce archivos un 5% menores, pero a costa de un mayor tiempo de codificación y decodificación, esta pequeña ganancia, puede emplearse también en aplicar un menor grado de compresión a la imagen, y obtener más calidad para un tamaño parecido. En la matriz anterior, la secuencia en zig-zag, es esta: −26, −3, 0, −3, −2, −6, 2, −4, 1 −4, 1, 1, 5, 1, 2, −1, 1, −1, 2, 0, 0, 0, 0, 0, −1, −1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 JPEG tiene un código Huffman para cortar la cadena anterior en el punto en el que el resto de coeficientes sean ceros, y así, ahorrar espacio: −26, −3, 0, −3, −2, −6, 2, −4, 1 −4, 1, 1, 5, 1, 2, −1, 1, −1, 2, 0, 0, 0, 0, 0, −1, −1, EOB Ruido producido por la compresión El resultado tras la compresión, puede variar, en función de la agresividad de los divisores de la matriz de cuantización, a mayor valor de esos divisores, más coeficientes se convierten en ceros, y más se comprime la imagen. Pero mayores compresiones producen mayor ruido en la imagen, empeorando su calidad. Una imagen con una fuerte compresión (1%-15%) puede tener un tamaño de archivo mucho menor, pero tendrá tantas imperfecciones que no será interesante, una compresión muy baja (98%-100%) producirá una imagen de muy alta calidad, pero, tendrá un tamaño tan grande que quizás interese más un formato sin pérdida como PNG. La mayoría de personas que naveguen por Internet estarán familiarizadas con estas imperfecciones, son el resultado de lograr una buena compresión; para evitarlos, se tendrá que reducir el nivel de compresión o aplicar compresión sin pérdida, produciendo mayores ficheros después. Decodificación El proceso es similar al seguido hasta ahora, sólo que de forma inversa. En este caso, al haber perdido información, los valores no coincidirán. Se coge la información de la matriz, se decodifica, y se pone cada valor en su casilla correspondiente. Después se multiplica cada uno de estos valores por el valor correspondiente de la matriz de cuantización usada, como muchos valores son ceros, sólo se recuperan (y de forma aproximada) los valores de la esquina superior izquierda. Después se deshace la transformación DCT: \begin{bmatrix} \end{bmatrix} \begin{bmatrix} \end{bmatrix} Y finalmente se suma 128 a cada entrada: \begin{bmatrix} \end{bmatrix} Para comparar las diferencias entre el bloque original y el comprimido, se halla la diferencia entre ambas matrices, la media de sus valores absolutos, da una ligera idea de la calidad perdida: \begin{bmatrix} \end{bmatrix} Se puede observar que las mayores diferencias están cerca de la mancha, y por la parte inferior, entre la esquina izquierda y el centro, notándose más esta última, ya que corre una mancha clara que antes estaba más hacia la esquina. La media de los valores absolutos de las restas es 4.8125, aunque en algunas zonas es mayor. Véase también JPEG2000, basado en wavelets. Enlaces externos Página web del grupo JPEG JPEG Standard (JPEG ISO/IEC 10918-1 ITU-T Recommendation T.81) en PDF o http://www. digicamsoft. com/itu/itu-t81-1. html HTML] Seminario de Imagen y Sonido Digital: Compresión de imagen Página web de la asignatura Multimedia de la ULPGC, explicación en vídeo del proceso de compresión JPEG
- JPEG (lyhenne sanoista Joint Photographic Experts Group) on häviöllistä pakkausta käyttävä bittikarttagrafiikan tallennusformaatti. Sille on laaja tuki eri selaimissa, joten sitä käytetään laajalti verkkosivuilla. JPEG-formaattiin tallennettaessa kuvasta poistetaan informaatiota erilaisten algoritmien avulla siten, että kuva näyttää ihmissilmän tarkastelemana mahdollisimman samanlaiselta kuin alkuperäinen kuvatiedosto. Pakkaussuhde voidaan määritellä tallennusvaiheessa. Yleisimmät tiedostopäätteet formaatille ovat . jpeg, . jfif, . jpg, . JPG ja . JPE, joista useimmiten käytössä on . jpg. JPEG kykenee tallentamaan 24 bittiä väri-informaatiota jokaista pikseliä kohden, joten JPEG-kuvassa voi olla 16 777 216 eri värisävyä. Formaatti on tarkoitettu nimenomaan valokuvien ja vastaavien kuvien pakkaamiseen. Kaavioihin ja muihin teräviä reunoja sisältäviin kuviin syntyy helposti näkyviä pakkaamisen aiheuttamia virheitä, ja niiden tallentamiseen PNG-tiedostomuoto soveltuukin paremmin. JPEG on myös yleinen digitaalikameroiden käyttämä pakatun kuvan tallennusmuoto.
- Joint Photographic Experts Group (JPEG), nom d'un groupe de travail en partenariat ISO et CEI (d'où le joint pour mixte). Créé en 1986, il rassemble des professionnels de l'industrie de l'image (TV, fax-télécoms, informatique). Cette initiative faisait suite aux demandes d'améliorations pour le facsimilé, qui donnera également la norme ISO/CEI JBIG (Joint Binary-level Image Group). Ce comité a donné son nom à la norme ouverte de compression d'images numériques JPEG. Ensuite cette norme a donné son nom au format de données défini et au format de fichier le plus utilisé pour contenir ces données. Généralement, le terme JPEG fait référence à la norme de compression JPEG, formellement ISO/CEI 10918-1 ou UIT-T Recommandation T.81. Cette norme décrit, parmi trois autres, une méthode de compression basée sur la DCT proposée initialement par le projet européen ESPRIT PICA (Photographic Image Coding Algorithm). Elle spécifie la transformation d'une image brute (au départ RVB 24 bits ou en niveau de gris 8 bits) en une suite de bits. Elle ne précise pas directement comment stocker les informations sur ses dimensions, son auteur, etc. Cela est le rôle d'un format de fichier. On utilisera généralement le JPEG File Interchange Format (JFIF 1.02) pour cela.
- Fájl:Phalaenopsis JPEG. jpg Egy virágról készült fénykép balról jobbra haladva lépcsőzetesen egyre veszteségesebb JPEG tömörítést használva. A JPEG – (Joint Photographic Experts Group) képek tárolására alkalmas fájlformátum. Kiterjesztéseként a . jpeg, . jpg, ritkábban a . jpe használt. A képen lévő információt veszteségesen tömöríti ez a formátum. Bár a tömörítés információveszteséggel jár, akár 10-100× kisebb fájlméret mellett is élvezhető a tömörített kép. Elsősorban fényképek, rajzok tárolására való. Grafikonok és egyéb hirtelen színátmenetű ábrák tárolására veszteségmentes tömörítésű formátum való. A JPEG-ben nem képpontokat tárolnak le, hanem a képet transzformálják a frekvencia-tartományba a DCT-vel (diszkrét cosinus transzformáció). A JPEG napjainkban az egyik leginkább elterjedt képformátum. Továbbfejlesztése a JPEG2000, mely a DCT (diszkrét cosinus transzformáció) helyett Wavelet transzformációt használ. Ez a 8×8 pixeles elemi blokkok határán jelent nagy könnyebbséget.
- JPEG è l'acronimo di Joint Photographic Experts Group, un comitato ISO/CCITT che ha definito il primo standard internazionale di compressione per immagini a tono continuo, sia a livelli di grigio che a colori. È un formato gratuito e open-source. Attualmente JPEG è lo standard di compressione delle immagini fotografiche più utilizzato. Le estensioni più comuni per questo formato sono . jpeg, . jpg, . jfif, . JPG, . JPE, anche se il più comune in tutte le piattaforme è . jpg. JPEG specifica solamente come una immagine può essere trasformata in uno stream di byte, ma non come questo può essere incapsulato in supporti di memorizzazione. Un ulteriore standard chiamato JFIF (JPEG File Interchange Format), creato da Independent JPEG Group, specifica come produrre un file appropriato per la memorizzazione su computer di uno stream JPEG. Nell'uso comune, quando qualcuno parla di "file JPEG" generalmente intende un file JFIF o alcune volte un file Exif JPEG. Ci sono, comunque, altri formati di file basati su JPEG, come ad esempio JNG.
- JPEG(ジェイペグ)とは、コンピュータなどで扱われる静止画像のデジタルデータを圧縮する方式のひとつ。またはそれをつくった組織(ISO/IEC JTC 1/SC 29/WG 1、Joint Photographic Experts Group)の略称。JPEG方式による画像ファイルにつけられる拡張子は jpg が多く使われているが、 jpeg 等が使われる場合もある。 一般的に非可逆圧縮の画像フォーマットとして知られているが、可逆圧縮形式もサポートしている。しかし、可逆圧縮は特許などの関係でほとんど利用されていない。 標準では、特定の種類の画像の正式なフォーマットがなく、JFIF形式が事実上の標準ファイルフォーマットとなっている。 動画を記録可能にしたものにMotion JPEGがある。 デジタルカメラの記録方式としてもよく利用されているが、デジタルカメラでは様々なオプション機能を使い、JFIFを拡張したExifなどのフォーマットとしてまとめられている。
- Met de afkorting JPEG wordt een bestandsindeling aangeduid voor het opslaan van afbeeldingen in digitale vorm. Het is een vorm van datacompressie en van broncodering. De naam staat voor Joint Photographic Experts Group. De JPEG-bestandsindeling kent diverse compressiemogelijkheden. Hoe hoger de compressie des te kleiner het bestand, en des te geringer de beeldkwaliteit. Het kwaliteitsverlies van JPEG valt niet veel op bij foto’s, maar wel bij bijvoorbeeld grafieken, lijnen of letters. Voor dit soort afbeeldingen is de GIF- of PNG-compressie beter geschikt, of de nieuwe RAW-methode waar de opslag plaatsvindt zonder compressie en het beeld later via geschikte software bewerkt kan worden. Zodoende wordt JPEG veelal gebruikt voor foto’s, bijvoorbeeld gemaakt met digitale camera’s. Een tekortkoming van de JPEG-bestandsindeling is dat slechts 8-bit per kleur mogelijk is en dat er geen mogelijkheid is om een deel van de afbeelding transparant te maken. In 2009 maken de wat duurdere digitale camera's foto's met meer bits per kleur. Ook flatbed scanners kunnen meer dan 8-bit scannen. Doordat de kwaliteit van de apparatuur steeds meer toeneemt, wordt de JPEG-bestandsindeling langzamerhand minder gebruikt. Een overblijfsel uit de tijd dat het besturingssysteem MS-DOS populair was, is dat de JPEG-bestanden vaak de extensie ‘JPG’ krijgen.
- JPEG (ofte forkortet til JPG) er et elektronisk bildeformat utviklet av Joint Photographic Experts Group. Dette bildeformatet bruker en komprimeringsmetode med kvalitetstap, men til gjengjeld blir filene oftest mye mindre enn ved bruk av bildeformater som bruker komprimeringsmetoder uten kvalitetstap. Dette formatet blir derfor ofte brukt ved lagring av digitale fotografier, spesielt fotografier til bruk på Internett. Komprimeringsmetoden til JPEG gjør det uegnet til lagring av tegninger med skarpe kanter eller linjer, og ved lagring av slike typer bilder brukes vanligvis bildeformatene PNG eller GIF, som lagrer bilder uten kvalitetstap.
- JPEG (wym. dżej-peg lub jot-peg) – format stratnej kompresji statycznych obrazów rastrowych, przeznaczony głównie do przetwarzania obrazów naturalnych, charakteryzujących się płynnymi przejściami barw oraz brakiem lub małą ilością ostrych krawędzi i drobnych detali. Motywacją do powstania tego standardu było ujednolicenie algorytmów kompresji obrazów monochromatycznych i kolorowych. Format plików JPEG/JFIF obok formatów GIF i PNG jest najczęściej stosowanym formatem grafiki na stronach WWW. Typ MIME zarejestrowany dla tego formatu nosi nazwę image/jpeg i został zdefiniowany w RFC 1341.
- • Baseline / Sequencial Encoding: os componentes da imagem são compactados de forma seqüencial da esquerda para a direita e de cima para baixo. • Progressive Encoding: a imagem é compactada em um processo de múltiplas linhas de varredura. Esta forma é geralmente utilizada em arquivos que são transmitidos pela Internet, pois possibilita a visualização da imagem inteira, em menor resolução, enquanto o restante da imagem esta sendo enviada. • Lossless: neste método não ocorre perda na qualidade da imagem. Existem duas variações: o original, que foi normalizado em 1992, e o novo método JPEG-LS, que deverá deixar obsoleto o formato JPEG “lossless” original. • Hierarchical Encoding: outro formato utilizado na Internet. Neste formato a imagem é comprimida em múltiplas resoluções (vários tamanhos), sendo que a de menor resolução (menor tamanho) é codificada e transmitida primeiro e na seqüência são compactadas e transmitidas as de melhores resoluções (as de maiores tamanhos) (CONCOLATO,2000) em ordem crescente de tamanho, e por fim é enviada a imagem completa em seu tamanho original. Os elementos de imagem das resoluções já recebidas são utilizados na próxima resolução, diminuindo desta forma o tamanho do arquivo. Com exceção do tipo “lossless”, todas as variantes apresentam perda de qualidade da imagem, sendo que esta perda é função da taxa de compressão . Um grupo de especialistas, denominados “Independente JPEG Group”, desenvolveu um parâmetro denominado “Índice de Qualidade (IQ)”, que varia de “1” (pior qualidade e maior taxa de compressão) a “100”. Estes índices influenciam as tabelas de quantização, que serão vistas a seguir. Com a alteração destas tabelas de quantização, varia-se a taxa de compressão e a qualidade da imagem (MIANO, 1999). Normalmente com uma taxa de compressão 20:1 já é possível perceber pequenas perdas de qualidade da imagem. Uma taxa de compressão de 100:1 produz uma imagem de baixa qualidade.
- În domeniul informaticii, JPEG este o metodă foarte des utilizată de compresie a imaginilor fotografice. Fişierele conţinând imagini compresate graţie acestei metode poartă în general extensia ". jpg".
- JPEG (произносится «джейпег», англ. Joint Photographic Experts Group — объединённая группа экспертов в области фотографии) — является широкоиспользуемым методом сжатия фотоизображений. Формат файла, который содержит сжатые данные обычно также называют именем JPEG; наиболее распространённые расширения для таких файлов . jpeg, . jfif, . jpg, . JPG, или . JPE. Однако из них . jpg самое популярное расширение на всех платформах. Фотография заката в формате JPEG с уменьшением степени сжатия слева направо Алгоритм JPEG является алгоритмом сжатия с потерей качества.
- JPEG ("Joint Photographic Experts Group") är en standard för destruktiv komprimering av digitala bilder, speciellt fotografiska sådana, medelst lokala diskreta cosinustransformer utförda i 8*8-block följt av kvantisering. På rätt sorts bilder kan JPEG ge extremt god komprimeringsgrad med bibehållen kvalitet. JPEG är däremot direkt olämpligt på ritningar eller datorskapade bilder med raka linjer och skarpa kontraster, där kompressionsgraden blir mycket låg om bildkvaliteten inte ska försämras allt för mycket. Förkortningen uttalas oftast ji-pegg på svenska men ibland även jay-peg eller ji-pe-/e/-ge.
- JPEG, Joint Photographic Experts Group (Birleşik Fotoğraf Uzmanları Grubu) tarafından standartlaştırılmış bir sayısal görüntü kodlama biçimidir. Bu biçim, 1994 yılında ISO 10918-1 adıyla standartlaşmıştır.
- 在電腦中,JPEG(發音為jay-peg, IPA:[ˈdʒeɪpɛg])是一種針對相片影像而廣泛使用的一種失真壓縮標準方法。這個名稱代表Joint Photographic Experts Group(聯合圖像專家小組)。此團隊創立於西元1986年,1992年發布了JPEG的標準而在1994年獲得了ISO 19918-1的認定。JPEG與視訊音訊壓縮標準的MPEG(Moving Picture Experts Group)很容易混淆,但兩者是不同的組織及標準。 JPEG本身只有描述如何將一個影像轉換為字节的數據串流(streaming),但並沒有說明這些位元組如何在任何特定的儲存媒體上被封存起來。JPEG的壓縮方式通常是破壞性資料壓縮(lossy compression),意即在壓縮過程中圖像的品質會遭受到可見的破壞,有一種以JPEG為基礎的標準Progressive JPEG是採用無失真的壓縮方式,但Progressive JPEG並沒有受到廣泛的支援。 一個由獨立JPEG小組(Independent JPEG Group)所建立的額外標準,稱為JFIF(JPEG File Interchange Format,JPEG檔案交換格式)詳細說明如何從一個JPEG串流,產出一個適合於電腦儲存和傳輸(像是在網際網路上)的檔案。在普遍的用法,當有人稱呼一個"JPEG檔案",一般而言他是意指一個JFIF檔案,或有時候是一個Exif JPEG檔案。然而,也有其他以JPEG為基礎的檔案格式,像是JNG。 使用JPEG格式壓縮的圖片檔案一般也被稱為JPEG Files,最普遍被使用的副檔名格式為. jpg,其他常用的副檔名還包括. jpeg,. jpe,. jfif以及. jif。JPEG格式的資料也能被嵌進其他類型的檔案格式中,像是TIFF類型的檔案格式。 JPEG/JFIF是最普遍在全球資訊網(World Wide Web)上被用來儲存和傳輸照片的格式。它並不適合於線條繪圖(drawing)和其他文字或圖示(iconic)的圖形,因為它的壓縮方法用在這些圖形的型態上,會得到不適當的結果(PNG和GIF格式通常是用來針對這種目的之圖形;GIF每一像素只有8位元,並不很適合於用在彩色照片,PNG可以被用來無失真地儲存照片,但是檔案太大讓它不適合在網頁上放照片)。 對於JFIF的MIME媒體型態是image/jpeg(定義在RFC 1341)。 編碼 在JPEG標準中這個選項大多都是很少使用。當應用到一個擁有每個像素24位元(24 bits per pixel,紅、藍、綠各有八位元)的輸入時,這邊只有針對更多普遍編碼方法之一的簡潔描述。這個特定的選擇是一種失真資料壓縮方法。 色彩空間轉換 首先,影像由RGB(紅綠藍)轉換為一種稱為YUV的不同色彩空間。这与模拟PAL彩色电视传输所使用的色彩空间相似,但是更类似于MAC电视传输系统运作的方式。但不是模拟NTSC,模拟NTSC使用的是YIQ色彩空间。 Y成份表示一個像素的亮度 U和V成份一起表示色調與飽和度。 YUV分量可以由PAL制系统中归一化(经过伽马校正)的R',G',B'经过下面的计算得到: Y.299R'+.587G'+.114B' U-.147R'-.289G'+.436B' V.615R'-.515G'-.1B' 這種編碼系統非常有用,因為人類的眼睛在Y成份可以比U和V看得更仔細。使用這種知識,編碼器(encoder)可以被設計得更有效率地壓縮影像。 縮減取樣(Downsampling) 上面所作的轉換使下一步驟變為可能,也就是減少U和V的成份(稱為"縮減取樣"或"色度抽样"(chroma subsampling)。在JPEG上這種縮減取樣的比例可以是4:4:4(無縮減取樣),4:2:2(在水平方向2的倍數中取一個),以及最普遍的4:2:(在水平和垂直方向2的倍數中取一個)。對於壓縮過程的剩餘部份,Y、U、和V都是以非常類似的方式來個別地處理。 離散餘弦變換(Discrete cosine transform) 下一步,將影像中的每個成份(Y, U, V)生成三個區域,每一個區域再劃分成如磁磚般排列的一個個的8×8子區域,每一子區域使用二維的離散餘弦變換(DCT)轉換到頻率空間。 如果有一個如這樣的的8×8的8-位元(~255)子區域: \begin{bmatrix} \end{bmatrix} 接著推移128,使其範圍變為 -128~127,得到結果為 \begin{bmatrix} \end{bmatrix} 且接著使用離散餘弦變換,和捨位取最接近的整數,得到結果為 \begin{bmatrix} \end{bmatrix} 注意左上角之相當大的數值。這就是DC係數。 量化(Quantization) 人类眼睛在一個相對大範圍區域,辨別亮度上細微差異是相當的好,但是在一個高頻率亮度變動之確切強度的分辨上,卻不是如此地好。這個事實讓我們能在高頻率成份上極佳地降低資訊的數量。簡單地把頻率領域上每個成份,除以一個對於該成份的常數就可完成,且接著捨位取最接近的整數。這是整個過程中的主要失真運算。以這個結果而言,經常會把很多更高頻率的成份捨位成為接近,且剩下很多會變成小的正或負數。 一個普遍的量化矩陣是: \begin{bmatrix} \end{bmatrix} 使用這個量化矩陣與前面所得到的DCT係數矩陣,得到結果為: \begin{bmatrix} \end{bmatrix} 舉個例子,使用−415(DC係數)且捨位得到最接近的整數 \mathrm{round} \left(\frac{-415}{16} \right) \mathrm{round} \left(\right) 熵編碼技術(entropy coding) 熵編碼是無失真資料壓縮的一個特別形式。它牽涉到將影像成份以Z字型(zigzag)排列,把相似頻率群組在一起(矩陣中往左上方向是越低頻率之係數,往右下較方向是較高頻率之係數),插入長度編碼的零,且接著對剩下的使用霍夫曼編碼。 JPEG標準也允許(但是並不要求)在數學上優於霍夫曼編碼的算术编码之使用。然而,這個特色幾乎很少被使用,因為它被專利所涵蓋,且它相較於霍夫曼編碼在編碼和解碼上會更慢。使用算術編碼一般會讓檔案更小約5%。 對於前者量化的係數所作的Z字型序列會是: −26, −3,, −3, −3, −6, 2, −4, 1 −4, −1, 1, −1, 2, −1, −1, 當剩下的所有係數都是零,對於過早結束的序列,JPEG有一個特別的霍夫曼編碼用詞。使用這個特殊的編碼用詞,EOB,該序列變為 −26, −3,, −3, −3, −6, 2, −4, 1 −4, −1, 1, −1, 2, −1, −1, EOB 壓縮比率與不自然痕跡(artifact) 按:artifact在這個領域又被解釋為膺像、非自然信號、人為現象。 在量化階段時,依照除數的不同,會使結果的壓縮比率可能有很多變化。1:1通常可得到無法使用肉眼分辨與原圖差異的影像。1:1壓縮通常是可行的,但與原圖相較,會看出明顯的不自然痕跡。壓縮的適當等級是依據要壓縮那一種影像而定。 使用全球資訊網的人,可能熟悉這種出現在JPEG數位影像,已知壓縮人為現象的不規則現象。這是由於JPEG演算法的量化步驟所造成的結果。這種現象在臉部照片中的眼睛四周特別明顯。他們可以藉由選擇壓縮的較低水平(使用較低的壓縮率)來減少這種現象;他們可能藉由使用無失真檔案格式來儲存一個影像來消除這種現象,然而針對照片影像,這樣通常會使檔案大小增加。 解碼 解碼來顯示影像,包含反向作以上所有的過程 取DCT係數矩陣(在把DC係數差異加回去之後) \begin{bmatrix} & -3 & -4 & 1 & 1 & & & \\ \end{bmatrix} 且以前面的量化矩陣乘以它,得到 \begin{bmatrix} -416 & -33 & -6 & 32 & 48 & -4 & & \\ & -24 & -56 & 19 & 26 & & & \\ -42 & 13 & 8 & -24 & -4 & & & \\ -56 & 17 & 44 & -29 & & & & \\ 18 & & & & & & & \\ & & & & & & & \\ & & & & & & & \\ & & & & & & & \end{bmatrix} 左上角的部份與原本DCT係數矩陣非常接近地相似。 使用反向DCT得到一個有數值的影像(仍然被移位128) \begin{bmatrix} -68 & -65 & -73 & -7 & -58 & -67 & -7 & -48 \\ -7 & -72 & -72 & -45 & -2 & -4 & -65 & -57 \\ -62 & -72 & -6 & -6 & 28 & -12 & -59 & -56 \\ -6 & -6 & -67 & -6 & -5 & -68 & -75 & -5 \\ \end{bmatrix} 且對每一個項目加上128 \begin{bmatrix} 6 & 63 & 55 & 58 & 7 & 61 & 58 & 8 \\ 58 & 56 & 56 & 83 & 18 & 88 & 63 & 71 \\ 6 & 52 & 62 & 113 & 15 & 116 & 7 & 67 \\ 69 & 62 & 65 & 1 & 12 & 86 & 59 & 76 \\ 68 & 68 & 61 & 68 & 78 & 6 & 53 & 78 \\ 83 & 96 & 77 & 56 & 7 & 83 & 83 & 89 \end{bmatrix} 這是解壓縮的子影像,且可以被用來與原本子影像相比(也可以看右方的影像),藉由取兩者之間的差異(原本—解壓縮)得到誤差值。 \begin{bmatrix} -8 & -8 & 6 & 8 & & & 6 & -7 \\ 2 & 7 & 6 & & -6 & -12 & -4 & 6 \\ -3 & 2 & 3 & & -2 & -1 & 1 & -3 \\ 11 & -11 & -3 & 5 & -8 & -3 & & \\ \end{bmatrix} 每個像素大約是5的平均絕對誤差,也就是說,<math>\frac{1}{64} \sum_{x1}^8 \sum_{y1}^8 |e(x,y)| 4.8125。誤差在左下角顯而易見,左下方的像素變得比它鄰近右方的像素還更暗。 用法 JPEG在色調及顏色平滑變化的相片或是寫實繪畫(painting)上可以達到它最佳的效果。在這種情況下,它通常比完全無失真方法作得更好,仍然可以產生非常好看的影像(事實上它會比其他一般的方法像是GIF產生更高品質的影像,因為GIF對於線條繪畫(drawing)和圖示的圖形是無失真,但針對全彩影像則需要極困難的量化)。 照片 JPEG壓縮的不自然現象可以很好地調和到細微非均勻材質的相片中,因此允許得到更高的壓縮率。 附註:以上的影像並不是IEEE/CCIR/EBU測試影像,且壓縮編碼器的設定並沒有指明或是可以得到。 中等品質的相片只有六分之一的儲存空間,但是幾乎沒有明顯的細節損失或是看得到的人為效果。然而,一旦超過一個某整的壓縮限度,壓縮的影像逐漸地顯現出可以看得到的瑕疵。參考比率失真理論(en:rate distortion theory)的文章有針對這種限度效果的數學上之解釋。 醫學影像:少見的JPEG 12位元支援模式 有很多醫學的影像系統可以建立和處理12位元JPEG影像。12位元JPEG格式已經是JPEG規格的一部份,但是非常少商业软件程序(或網頁瀏覽器)支援這種不常使用的JPEG格式。 其他失真壓縮的編碼格式 更新的失真方法,尤其是小波壓縮(wavelet compression),在這些情況下甚至能作得更好。然而,JPEG是一種建立得相當好的標準,擁有很多可使用的軟體,包含自由軟體,因此到25年它持續被大量使用。很多小波演算法受到專利保護,要在很多軟體專案中自由地使用他們是困難或是不可能的。 JPEG委員會現在也已經建立其自有的小波基礎標準-JPEG 2,希望最終能取代原來的JPEG標準。 潛在的專利爭議 在22年 Forgent Networks主張他擁有且將會履行在JPEG技術上的專利權,起因於一個在1986年已經被歸檔的專利。((英文)美國專利 4,698,672)。這個公告已經引起一陣大騷動,令人想起Unisys試圖主張對於GIF影像壓縮標準的權利。 JPEG委員會審慎調查這個在22年所主張的專利,且發現他們因為前案而無效作廢。 其他的也已推斷Forgent並無擁有涵蓋JPEG的專利 。儘管如此,在22年和24年之間,Forgent藉由把他們的專利授權給某些3家公司,而獲得大約9千萬美金。在24年4月,Forgent控告31家其他公司來強求更多的授權支付。同年的七月,21家較大的電腦公司組成的協會提出反控告,包含使該專利無效的目標。然而,到25年7月的時候,這場官司仍然持續中(德國新聞連結)。 JPEG委員會在他的明確目標中有一項,是他們的標準在不支付授權金之下是可以被實作的,且他們已從超過2個大型組織中,得到適當的授權權利給他們即將到來的JPEG 2標準。 無損耗旋轉 (lossless JPEG rotation) 雖然任何對JPEG圖像的處理都有可能導致因為解壓後再壓縮而引起的損耗,然而,對於簡單的旋轉動作,數學上是可以有辦法使圖像得以旋轉而無損圖像本身的資料。也就是說,有一種方法可以在無需把圖像解壓後才可以旋轉。這是因為JPEG的檔案格式本身是以一個個模塊為單位來壓縮,所以,只需要把模塊重排,再對每個模塊旋轉,就可以達至無損耗的旋轉。 目前只有少數繪圖軟件支援無損耗旋轉,但需要使用者在操作上加以注意。例如:在Adobe Photoshop裡,用戶若要作無損耗旋轉前,必須在載入圖像之後立刻用“Save As... ”功能儲存一個備份。然後當圖像旋轉過後,由於Photoshop已掌握了圖像的基本資料,所以在儲存時得以使用原來的設定。若沒有作事先儲存,Photoshop就會把旋轉後的圖像重新計算各項參數,並重新對圖像進行壓縮處理。這樣就會造成資料的損耗。 在Independent JPEG Group所提供的源碼上,有jpegtran程式,就提供了優化Huffman,轉成漸進式,鏡射,旋轉這些無損耗轉換。 參看:無損耗JPEG旋轉程式列表(英語) 參見 數位相機-數位相框 影像壓縮 JPEG-LS 非失真壓縮標準 JPEG 2 Motion JPEG 影像編輯程式 独立JPEG小组(Independent JPEG Group)的Libjpeg 外部連結 Official JPEG官方網站 JPEG常見問題與回答(FAQ) Wotsit. org在JPEG格式的進入點 ITU T.81 JPEG壓縮(PDF) JFIF檔案格式(PDF) JPEG静态图像压缩标准,Gregory K. Wallace简编 JPEG壓縮 (Gernot Hoffman) JPEG資源的開放列表
|