# Some basic knowledge about graphics

Source: Internet
Author: User

1. Concepts and differences between bitmap and vector map

Vector: a vector is a geometric shape generated in mathematics. The elements of these images are points, lines, rectangles, polygon, circles, and arcs, they are obtained through mathematical formulas. As we all know, Flash is a vector animation production software. Commands such as beginfill and lineto used in as are based on vector graph operations.

Bitmap: a bitmap is also called a grating image. It is composed of small blocks (pixels) arranged in the form of rectangular grids. In short, bitmap is a pattern composed of countless color points.

Comparison between the two: vector images can be infinitely enlarged without distortion, while bitmaps are distorted.

A Bitmap consists of pixels and a vector graph consists of vector lines.

Bitmap can present more colors, but less vector images.

Vector images are small in size, but consume computing resources. bitmaps consume more memory resources, but less computing resources.

The bitmap image is defined by the width and height of the image. Measured in pixels, the number of digits contained in each pixel indicates the number of colors included in the pixel. In a bitmap image using an RGB color model, pixels are composed of three Bytes: Red, green, and blue. Each byte contains a value ranging from 0 to 255. When bytes and pixels are merged, they can produce colors similar to the colors of the art mixture painting. For example, a pixel with a red byte value of 255, a green byte value of 102, and a blue byte value of 0 can form a bright orange.

The quality of bitmap images is determined by the image resolution and color depth bit values. Resolution depends on the number of dimensions contained in the image. The larger the number of pixels, the higher the resolution, and the more precise the image. The color depth is also called the number of digits of color, which is related to the amount of information that pixels can contain. The number of binary bits used to represent the color of each vertex in the bitmap is an important indicator of resolution. Commonly used one (monochrome), two (4 color, CGA), four (16 color, VGA), eight (256 color), 16 (enhanced color ), 24-bit and 32-bit (true color. Bitmap with a color depth of more than 16 digits can be further classified based on the number of digits indicating the RGB primary color or the CMYK primary color (some also include the alpha channel, CMYK ), for example, an image with a color depth of 16 bits per pixel cannot display the number of colors of an image with a color depth of 48 bits. Therefore, the shadow of a 48-bit image is smoother than a 16-bit image.

Because the bitmap image is related to the resolution, it cannot be scaled well. This feature is especially prominent when the bitmap image is enlarged. Generally, bitmap amplification is detrimental to its details and quality.

2. Three graphic formats

Adobe Flash Player supports GIF, JPG, and PNG bitmap formats. For bitmap images using GIF and PNG, you can add an extra byte-alpha channel to each pixel to indicate the transparency of the pixel.

GIF

The image exchange format (GIF) was initially developed by CompuServe in 1987 as a method for delivering 256-color (8-bit) images. This format provides a small file size and is an ideal format for web-based images. Limited by the color palette in this format, GIF images are generally not applicable to photos, and photos usually require high shadows and color gradient. A GIF image can generate a transparency that allows color ing to be clear (or transparent ). This allows the background color of the webpage to be displayed through the mapped transparency image.

JPEG

Developed by the joint image Expert Group (JPEG), the JPEG (usually JPG) image format uses a lossy compression algorithm to allow 24-bit color depth to have a small file size. Lossy compression means that each time an image is saved, the image quality and data are lost, but smaller file sizes are generated. Since JPEG can display millions of colors, it is an ideal format for photos. The function of compressing images allows you to control image quality and file size.

PNG

The portable network image (PNG) format is developed as an open source alternative to the patented GIF file format. PNG supports up to 64-bit color depth and allows up to 16 million colors. Because PNG is a relatively new format, some earlier Browsers Do not support PNG files.

Related Keywords:

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

## A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

• #### Sales Support

1 on 1 presale consultation

• #### After-Sales Support

24/7 Technical Support 6 Free Tickets per Quarter Faster Response

• Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.