JPEG is a standardized image compression mechanism. It stands for Joint Photographic Experts Group, the original name of the committee that wrote the standard. JPEG is designed for compressing either full-color or gray-scale images of natural, real-world scenes. It works well on photographs, naturalistic artwork, and similar material; not so well on lettering, simple cartoons, or line drawings. JPEG is a lossy compression algorithm, meaning that the decompressed image isn't quite the same as the one you started with. JPEG is designed to exploit known limitations of the human eye (more about this later), notably the fact that small color changes are perceived less accurately than small changes in brightness. A useful property of JPEG is that the degree of lossiness can be varied by adjusting compression parameters. This means that the image maker can trade off file size against output image quality. The code we have developed includes:
- Color space transformation between RGB and YCbCr
- Quantization
- Optimized encoding
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 is 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 (generation loss). To avoid this, an image that is being modified or may be modified in the future can be saved in a lossless format, and a copy exported as JPEG for distribution.
Index Terms: Matlab, source, code, JPEG, image, compression, DCT, quantization, coding, encoding, decoding, color, conversion.
Figure 1. JPEG image | |||
A simple and effective source code for JPEG Image Compression |
0 comments:
Post a Comment