Home > Common Problem > body text

The encoding method used during image digitization determines what the resulting digital image is

青灯夜游
Release: 2022-08-12 16:38:23
Original
7920 people have browsed it

determines the "file format" of the resulting digital image. The amount of image data obtained after digitization is very large, and coding technology must be used to compress the amount of information; in a certain sense, coding and compression technology is the key to image transmission and storage. In order to standardize image compression, the International Telecommunication Union, the International Organization for Standardization ISO and the International Electrotechnical Commission IEC have formulated and continue to formulate a series of international standards for still and moving image encoding. The approved standards mainly include JPEG standard, MPEG standard, H.261 wait.

The encoding method used during image digitization determines what the resulting digital image is

The operating environment of this tutorial: Windows 7 system, Dell G3 computer.

The encoding method used in the image digitization process determines the "file format" of the resulting digital image.

Image digitization is the process of converting analog images with continuous distribution of spatial distribution and brightness values ​​into digital images that can be processed by computers through sampling and quantification.

The process of converting a picture into a form that can be processed by a computer - a digital image.

The specific process of image digitization

To process images in a computer, you must first digitize real images (photos, pictorials, books, drawings etc.) are digitally converted into a display and storage format acceptable to the computer, and then analyzed and processed by the computer. The digitalization process of images is mainly divided into three steps: sampling, quantization and encoding.

Sampling

The essence of sampling is how many points are used to describe an image. The quality of the sampling results is measured by the image resolution mentioned above. Simply put, a continuous image in two-dimensional space is divided into a rectangular network structure at equal intervals in the horizontal and vertical directions, and the tiny squares formed are called pixels. An image is sampled into a set of finite pixels. For example: an image with a resolution of 640*480 means that the image is composed of 640*480=307200 pixels.

As shown in the figure below, the left image is the object to be sampled, and the right image is the sampled image. Each small grid is a pixel.

The encoding method used during image digitization determines what the resulting digital image is

The sampling frequency refers to the number of samples in one second, which reflects the size of the interval between sampling points. The higher the sampling frequency, the more realistic the image samples obtained and the higher the quality of the image, but the greater the amount of storage required.

When sampling, the selection of the sampling point interval size is very important. It determines the degree to which the sampled image can truly reflect the original image. Generally speaking, the more complex the picture and the richer the colors in the original image, the smaller the sampling interval should be. Since the sampling of two-dimensional images is a generalization of one-dimensional, according to the signal sampling theorem, to accurately restore the image from the sampling samples, the Nyquist theorem of image sampling can be obtained: the frequency of image sampling must be greater than or equal to Twice the highest frequency component of the source image.

Sampling frequency refers to the number of samples per second, which reflects the interval between sampling points. The higher the sampling frequency, the more realistic the image samples obtained and the higher the quality of the image, but the greater the amount of storage required.

When sampling, the selection of the sampling point interval size is very important. It determines the degree to which the sampled image can truly reflect the original image. Generally speaking, the more complex the picture and the richer the colors in the original image, the smaller the sampling interval should be. Since the sampling of two-dimensional images is a generalization of one-dimensional, according to the sampling principle of signals, to accurately restore images from sampling samples, the Nyquist theorem of image sampling can be obtained: the frequency of image sampling must be greater than or equal to Twice the highest frequency component of the source image. [3]

Quantization

Quantization refers to the range of values ​​to be used to represent each point after image sampling. The result of quantification is the total number of colors that the image can accommodate, which reflects the quality of the sampling.

For example: If a point is stored in 4 bits, it means that the image can only have 16 colors; if a point is stored in 16 bits, there are 216=65536 colors. Therefore, the number of quantization bits is getting larger and larger, which means that the image can have more colors, which can naturally produce more detailed image effects. However, it will also take up more storage space. The basic issue for both is the trade-off between visual effects and storage space.

Suppose there is a black and white grayscale photo, because its grayscale changes in the horizontal and vertical directions are continuous, it can be considered to have countless pixels, and the grayscale value at any point is There are infinite possible values ​​from black to white. This simulated image can be decomposed into an approximate finite number of pixels by sampling at equal intervals along the horizontal and vertical directions, and the value of each pixel represents the grayscale (brightness) of the pixel. Quantize the grayscale so that its value becomes a limited number of possible values.

An image obtained through such sampling and quantization is a limited number of pixels that are discretely distributed in space, and a limited number of discrete possible values ​​in gray value, which is called a digital image. As long as there are enough horizontal and vertical sampling points and the number of quantization bits is large enough, the quality of the digital image will be no less good than the original analog image.

The number of discrete values ​​determined during quantization is called the quantization series. The number of binary digits required to represent the quantized color value (or brightness value) is called the quantization word length. Generally, 8-bit, 16-bit, 24-bit or higher quantization word lengths can be used to represent the color of the image; the longer the quantization word length. The larger it is, the more truly it can reflect the color of the original image, but the capacity of the resulting digital image will also be larger.

For example: In the figure below, the curve (right figure) of the continuous image gray value along line segment AB (left figure) takes the maximum white value and the minimum black value.

The encoding method used during image digitization determines what the resulting digital image is

Sampling first: Sampling is performed at equal intervals along line segment AB. The sampled values ​​are continuously distributed in gray value, as shown in the left picture below;

The encoding method used during image digitization determines what the resulting digital image is

Requantization: The continuous gray value is then digitized (8 levels of gray scale), as shown in the right picture above.

Compression Coding

The amount of image data obtained after digitization is very huge, and coding technology must be used to compress the amount of information. In a certain sense, coding and compression technology is the key to image transmission and storage. There are many mature coding algorithms applied to image compression. Common ones include image predictive coding, transform coding, fractal coding, wavelet transform image compression coding, etc.

When high-rate compression is required for transmitted or stored image information, complex image coding technology must be adopted. However, without a common standard as a basis, different systems cannot be compatible. Unless the details of each encoding method are exactly the same, it will be very difficult to connect the systems.

In order to standardize image compression, after the 1990s, the International Telecommunication Union (ITU), the International Organization for Standardization ISO and the International Electrotechnical Commission IEC have formulated and continue to formulate a series of international standards for still and moving image encoding. The approved standards mainly include JPEG standard, MPEG standard, H.261, etc.

Encoding comparison

BMP image file format

BMP is a hardware device-independent Image file format, very widely used. It uses a bit-mapped storage format and does not use any other compression except for the optional image depth. Therefore, the BMP file takes up a lot of space.

The image depth of BMP files can be selected from lbit, 4bit, 8bit and 24bit. When BMP files store data, the image is scanned from left to right and bottom to top. Since the BMP file format is a standard for exchanging graph-related data in the Windows environment, all graphics and image software running in the Windows environment support the BMP image format.

A typical BMP image file consists of three parts: the bitmap file header data structure, which contains the type, display content and other information of the BMP image file; the bitmap information data structure, which contains the width, display content, etc. of the BMP image. High, compression method, and define color and other information.

PCX image file format

The formation of PCX image files has a development process. The first prototype of PCX appeared in a commercial software package for painting called PC PAINBRUSH launched by ZSOFT. Later, Microsoft transplanted it to the Windows environment and became a sub-function in the Windows system.

was first widely used in Microsoft Windows 3.1. With the popularity and upgrade of Windows, coupled with its powerful image processing capabilities, PCX, together with GIF, TIFF, and BMP image file formats, has been increasingly used It is supported by many graphics and image software tools and is getting more and more attention from people. PCX is the earliest file format to support color images and now supports up to 256 colors.

PCX designers had the vision to introduce the color image file format ahead of time, making it a very popular image file format now. PCX image files consist of a file header and actual image data. The file header consists of 128 bytes, describing version information and the horizontal and vertical resolution of the image display device, as well as information such as color palette: in actual image data, it represents the image data type and color type.

The data in PCX image files are image data compressed using PCXREL technology. PCX is the image file format for PC Paintbrush. The image depth of PCX can be selected from 1, 4, and 8 bit. Since this file format appeared earlier, it does not support true color. PCX files use RLE run-length encoding, and the compressed image data is stored in the file body.

Therefore, when writing the collected image data into PCX file format, it must be RLE encoded: and when reading a PCX file, it must first be RLE decoded before further display and processing.

TIFF Image File Format

TIFF (TaglmageFileFormat) image file is a relatively common image file format developed by Aldus and Microsoft for desktop publishing systems. . The TIFF format is flexible and changeable, and it defines four different formats: TIFF-B is suitable for binary images; TIFF-G is suitable for black and white grayscale images; TIFF-P is suitable for color images with a palette; TIFF- R is suitable for RGB true color images.

TIFF supports multiple encoding methods, including RGB uncompressed, RLE compression and JPEG compression. TIFF is the most complex of the existing image file formats. It is scalable, convenient, and modifiable, and can be provided to image editing programs running in environments such as IBM PC.

A TIFF image file consists of three data structures, namely the file header, one or more directories containing mark pointers called IFDs, and the data itself. The first data structure in a TIFF image file is called the Image File Header or IFH.

This structure is the only part with a fixed position in a TIFF file; the IFD image file directory is an information block with variable byte length. The Tag mark is the core part of the TIFF file. In the image file directory All image parameters to be used are defined in , and each directory entry in the directory contains a parameter for the image.

GIF file format

The original meaning of GIF (Graphics Interchange Format) is "Image Interchange Format", which is an image file format developed by CompuServe in 1987. The data of the GIF file is a continuous tone lossless compression format based on the LZW algorithm. Its compression rate is generally around 50%, and it does not belong to any application. Almost all relevant software currently supports it, and there are a large number of software in the public domain that use GIF image files.

The data of GIF image files is compressed, and variable length and other compression algorithms are used. Therefore, the image depth of GIF ranges from 1 bit to 8 bit, that is, GIF supports up to 256 colors of images.

Another feature of the GIF format is that it can store multiple color images in one GIF file. If the multiple image data stored in one file are read out one by one and displayed on the screen, Constitutes the simplest animation.

GIF decoding is faster because the GIF image is stored in interlaced lines and can be scanned in four passes when decoding and displaying at the same time. Although the first scan only showed one-eighth of the entire image, and the second scan only showed 1/4, it already showed the overview of the entire image.

When displaying GIF images, interlaced images will make you feel that they appear to be displayed faster than other images. This is the advantage of interlaced images.

JPEG file format

JPEG is the abbreviation of Joint Photographic Experts Group (Joint Photographic Experts Group), and the file extension is ".jpg" or ".jpeg" , is the most commonly used image file format. It was developed by a software development association. It is a lossy compression format that can compress images into a small storage space. Repeated or unimportant data in the image will be lost, so It is easy to cause damage to the image data.

Especially if the compression ratio is too high, the quality of the image restored after final decompression will be significantly reduced. If you pursue high-quality images, it is not advisable to use too high a compression ratio. However, JPEG compression technology is very advanced. It uses lossy compression to remove redundant image data, and can display very rich and vivid images while obtaining extremely high compression rates. In other words, it can use the least disk space to obtain more vivid images. Good image quality.

And JPEG is a very flexible format that has the function of adjusting image quality, allows files to be compressed with different compression ratios, and supports multiple compression levels. The compression ratio is usually between 10:1 and 40: Between 1, the larger the compression ratio, the lower the quality; conversely, the smaller the compression ratio, the better the quality.

For example, a 1.37Mb BMP bitmap file can be compressed to 20.3KB. Of course, you can also find a balance between image quality and file size. The JPEG format mainly compresses high-frequency information and retains color information well. It is suitable for use on the Internet, can reduce image transmission time, can support 24-bit true color, and is also commonly used in images that require continuous tone.

JPEG format is currently the most popular image format on the Internet. It is a format that can compress files to the smallest format. When stored in JPEG format in Photoshop software, it provides 11 levels of compression, represented by levels 0-10. . Among them, level 0 has the highest compression ratio and the worst image quality. Even when saving at level 10 quality with virtually no loss of detail, the compression ratio can reach 5:1. When saving in BMP format, a 4.28MB image file is obtained. When saving in JPG format, the file is only 178KB, with a compression ratio of 24:1.

After many comparisons, using level 8 compression is the best ratio for both storage space and image quality. The JPEG format is widely used, especially on the Internet and CD-ROM readers.

Currently, all browsers support the image format JPEG, because the file size of JPEG format is smaller and the download speed is fast. As an upgraded version of JPEG, JPEG2000 has a compression rate about 30% higher than JPEG, and supports both lossy and lossless compression.

An extremely important feature of the JPEG2000 format is that it can achieve progressive transmission, that is, first transmit the outline of the image, and then gradually transmit the data, continuously improving the image quality, allowing the image to be displayed from hazy to clear.

In addition, JPEG2000 also supports the so-called "region of interest" feature, which allows you to arbitrarily specify the compression quality of the area of ​​interest on the image, and you can also select the specified part to decompress first. JPEG2000 has obvious advantages over JPEG and is backward compatible, so it can replace the traditional JPEG format.

JPEG2000 can be used in traditional JPEG markets, such as scanners, digital cameras, etc., and can also be used in emerging fields, such as network transmission, wireless communications, etc.

TGA format

TGA format (Tagged Graphics) is an image file format developed by the American company Truevision for its display card. The file suffix is ​​".tga" , has been accepted by the international graphics and image industry. TGA has a relatively simple structure and is a universal format for graphics and image data. It has a great influence in the field of multimedia and is the preferred format for converting computer-generated images to television. The biggest feature of the TGA image format is that it can create irregular-shaped graphics and image files. Generally, graphics and image files are square. If you need round, diamond-shaped or even empty image files, TGA can be used. Come in handy! The TGA format supports compression, using a distortion-free compression algorithm.

EXIF format

EXIF format is a digital camera image file format promoted by Fujifilm in 1994. In fact, it is the same as JPEG format. The difference is that in addition to saving image data, It can also store exposure data and incidental information such as shooting date, aperture, shutter, flash data, and small-size images.

FPX image file format

FPX image file format (extension fpx) was jointly developed by Kodak, Microsoft, HP and Live PictureInc, and was launched in June 1996 Officially released in March, FPX is a multi-resolution image format, that is, images are stored in a series of different high and low resolutions. The advantage of this format is that the image quality can be maintained when the image is enlarged. In addition, when retouching When FPX images are processed, only the modified part will be processed, and the entire image will not be processed together, thereby reducing the burden on the processor and memory, and reducing the image processing time.

SVG format

SVG is a scalable vector graphics format. It is an open standard vector graphics language that can be arbitrarily enlarged for graphic display. The edges are extremely clear. The text remains editable and searchable in the SVG image. There are no font restrictions. The generated files are small and download quickly. Very suitable for designing high-resolution Web graphics pages.

PSD file format

This is a special file format for Photoshop image processing software, and the file extension is. psd, which can support various image features of layers, channels, masks and different color modes, is a non-compressed original file saving format. The scanner cannot directly generate files in this format. PSD files sometimes have a large capacity, but since all original information can be retained, saving in PSD format is the best choice for images that have not yet been completed during image processing.

CDR file format

CDR format is a special graphics file format for the famous drawing software CorelDRAW. Since CorelDRAW is a vector graphics drawing software, CDR can record the attributes, location, paging, etc. of the file. However, it has poor compatibility. It can be used in all CorelDraw applications, but other image editing software cannot open such files.

PCD file format

PCD is the abbreviation of Kodak PhotoCD, and the file extension is. pod is a Photo CD file format developed by Kodak, which can only be read by other software systems. This format uses the YCC color model to define the colors in the image. The YCC and CIE color spaces contain many more colors than the RGB and CMYK colors of monitors and printing devices. PhotoCD images are mostly of very high quality.

DXF file format

DXF is the abbreviation of Drawing Exchange Format, and the extension is. dxf is the graphics file format in AutoCAD. It stores graphics in ASCII mode and is very accurate in expressing the size of graphics. It can be called and edited by large software such as CorelDraw and 3DS.

UFO file format

It is a dedicated image format of the famous image editing software Ulead Photolmapct, which can completely record all image attributes processed by Photolmapct. It is worth mentioning that UFO files use objects instead of layers to record image information.

EPS file format

EPS is the abbreviation of Encapsulated PostScript, which is a cross-platform standard format. The extension on the PC platform is. eps, on the Macintosh platform. epsf, mainly used for the storage of vector images and raster images. The EPS format is described in the PostScript language and can save other types of information, such as multiple tone curves, Alpha channels, color separations, clipping paths, screen information, tone curves, etc., so the EPS format is often used for printing or printout. Multiple EPS format options in Photoshop allow for comprehensive control over print printing, even better than the TIFF format in some cases.

PNG Image File Format

The original name of PNG (Portable Networf Graphics) is "Portable Network Graphics", which is the latest image file format accepted on the Internet. PNG can provide lossless compressed image files that are 30% smaller than GIF. It provides both 24-bit and 48-bit true color image support as well as many other technical supports. Since PNG is very new, not all programs can currently use it to store image files, but Photoshop can handle PNG image files and can also be stored in the PNG image file format.

For more related knowledge, please visit the FAQ column!

The above is the detailed content of The encoding method used during image digitization determines what the resulting digital image is. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template