Joke Collection Website - Talk about mood - Pixel knowledge

Pixel knowledge

1. Detailed explanation of pixel related knowledge~Thank you

"Pixel" is composed of the two letters Picture and Element, and is used to calculate digital images. A unit, just like a photograph, a digital image also has continuous shades of light and shade. If we enlarge the image several times, we will find that these continuous tones are actually composed of many small square dots of similar colors. These small squares A point is the smallest unit "pixel" that makes up an image.

Pixel is the most basic unit of an image (Pixel). The simplest demonstration is to use image editing software to enlarge the image to an indivisible image unit. The ratio of the length and width of a single pixel is not necessarily square (1:1). According to different systems, there are "1.45:1" and "0.97:1" ratios. Each pixel has a corresponding color palette.

1bit=2 colors 7bit=128 colors 4bit=16 colors 8bit=256 colors 5bit=32 colors 16bit=32768 colors 6bit=64 colors 24bit=16777216 colors In other words, the higher the pixel, the more The richer the color palette, the more realistic the color can be expressed. The simplest demonstration is to use image editing software to enlarge the image to indivisible image units.

2. Knowledge of resolution

Image resolution (PPI)

Image resolution (ImageResolution): refers to the amount of information stored in the image . There are many ways to measure this resolution. It is typically measured in pixels per inch (PPI, pixel per inch); of course, it is also measured in pixels per centimeter (PPC, pixel per centimeter). The values ??of image resolution and image size (height and width) together determine the size of the file and the quality of the output. The larger the value, the more disk space the graphic file will occupy. Image resolution affects file size in a proportional relationship, that is, file size is proportional to the square of its image resolution. If you keep the image size unchanged and double the image resolution, the file size will quadruple.

3. A few days ago, someone Doudou gave me some knowledge about pixels. He said that pixels can only be washed out.

Nonsense. . Your three million dollars is only as big as a palm, so it becomes clear when you look at it. . The pixel density of 13 million is much greater than yours. . . Same big screen. . Yours is an enlarged picture. And thirteen million are compressed images. Its normal picture area is more than four times your normal area. . Even if you try to maximize it, you won't be able to catch up with others who don't scale it up. . Think about which one looks clearer. .

I'm not insulting your intelligence. . . Generally speaking, pixels do not affect image quality. . . But the effect you wash out will be relatively better with higher pixels, because the compressed pixel density is higher and the realism is higher. . . Definitely not washing the poster. . The washed out poster will look the same as your normal photo. . . This knowledge is of no use. . Let's just take pictures. . There is nothing wrong with high pixels being clearer than low pixels in the same area.

4. Asking for advice about pixels and resolution

True color images have greatly improved the types of colors, and it has brought great convenience to the production of high-quality color images. Lots of conveniences. True color can also be said to be another name for RGB. Technically speaking, True Color refers to the type of image written to disk. RGB color refers to the display mode of the monitor. However, these two terms are often used as synonyms because the results are the same. All have the ability to display more than 160,000 colors at the same time. The RGB image is unmapped, it can freely obtain the required color from the system's color table, and this color directly corresponds to the color displayed on the PC.

All bitmaps contain the concept of pixels.

Just like kilograms and meters, pixels are also a unit of measurement, except that they are the unit used to measure the photos of your favorite girl in the computer. ;> Pixels, points, and sample points are the means of measuring images at different stages on the computer (Someone: "Report to the editor, he copied this sentence from a book!" Wu Mu: "Look at my God Deaf! I let you say it!" The screams are endless~). Now let me talk about the sample point again, when we set the resolution of the scanner. This resolution determines how many points per inch the scanner takes from the source image. At this time, the scanner divides the source image into a large number of grids, and then takes a point from each grid to represent this The color included in the grid, this point is the sample point. As for the concept of point, everyone can understand it based on the meaning of the word itself. But let me digress here. Some people also call the scanner's resolution unit dpi, which is how many dots per inch. Everyone should know that this dpi is different from the dpi of the printer. The number of dots per inch of the scanner should be called sample dots. Let me look at pixels again. A pixel is a unit of light on a display, and the number of pixels per inch is a measure of the resolution of an image display.

In popular terms, pixels are dots, and they are dots of a single color!

Today's monitors usually have a resolution of 1024*768, which means that there are 1024 pixels in the length of the current monitor, that is, there are 1024 points that can display colors, and there are 768 in the height. Such a point!

In fact, the easiest way to understand pixels is to zoom in on part of the picture. You can see that these pictures are actually composed of dots of a single color!

5. Knowledge about digital camera pixels

Usually when we buy a digital camera, we can always see "XXX million maximum pixels" and "XXX effective pixels" on the camera body. ” performance label.

So, what is the maximum pixel and what is the effective pixel? What are the differences between the two? The maximum pixel value refers to the actual pixels of the photosensitive device. This data usually includes the non-imaging portion of the photosensitive device.

The English name of effective pixels is "Effective Pixels". Different from the maximum pixel, the value of the effective pixel refers to the pixel value that actually participates in photosensitive imaging.

It is a value converted at the lens zoom ratio. Taking the Minolta DiMAGE7 model as an example, its CCD pixels are 5.24 million (5.

24Megapixel). Because part of the CCD does not participate in imaging, its effective pixels are 4.9 million.

The storage method of digital pictures is generally based on pixel (Pixel) as the basic unit. Each pixel is the smallest unit of area in a digital picture. The larger the pixels, the larger the image area.

On the premise that no more light enters the photoreceptor, the only way to increase the area of ??a picture is to increase the area of ??the pixels. When the pixel area remains unchanged, the maximum picture pixel that a digital camera can obtain is the effective pixel.

Usually when we buy a digital camera, we should pay attention to its effective pixel value, because the effective pixel value is the key to determining the picture quality. .

6. I want to know the basic knowledge about bitmaps, pixels, etc.

1. BMP file composition BMP file consists of four parts: file header, bitmap information header, color information and graphics data composition.

1. BMP file header: The BMP file header data structure contains information such as the BMP file type, file size, and bitmap starting position.

typedef struct tagBITMAPFILEHEADER{ WORD bfType; The type of the bitmap file must be BM DWORD bfSize; The size of the bitmap file in bytes WORD bfReserved1; The reserved word of the bitmap file must be 0 WORD bfReserved2; The reserved word of the bitmap file , must be 0 DWORD bfOffBits; The starting position of the bitmap data, expressed as an offset relative to the bitmap file header, in bytes} BITMAPFILEHEADER; 2. Bitmap information header: BMP bitmap information header data is used Used to describe information such as the size of the bitmap.

typedef struct tagBITMAPINFOHEADER{ DWORD biSize; The number of bytes occupied by this structure LONGbiWidth; The width of the bitmap in pixels LONGbiHeight; The height of the bitmap in pixels WORD biPlanes; The level of the target device , must be 1 WORD biBitCount The number of bits required for each pixel, must be one of 1 (bicolor), 4 (16 colors), 8 (256 colors) or 24 (true color) DWORD bipression; bitmap compression type, must Is one of 0 (no compression), 1 (BI_RLE8 compression type) or 2 (BI_RLE4 compression type) DWORD biSizeImage; the size of the bitmap in bytes LONG biXPelsPerMeter; the horizontal resolution of the bitmap in pixels per meter LONG biYPelsPerMeter ; Bitmap vertical resolution, number of pixels per meter DWORD biClrUsed; The number of colors in the color table actually used by the bitmap DWORD biClrImportant; The important number of colors in the bitmap display process} BITMAPINFOHEADER; 3. Color table: The color table is used for illustration The color in the bitmap has several entries. Each entry is an RGBQUAD type structure that defines a color. typedef struct tagRGBQUAD { BYTE rgbBlue; Brightness of blue (value range is 0-255) BYTE rgbGreen; Brightness of green (value range is 0-255) BYTE rgbRed; Brightness of red (value range is 0-255) BYTE rgbReserved; Reserved, must be 0 } RGBQUAD; The number of RGBQUAD structure data in the color table is determined by biBitCount: When biBitCount=1, 4, 8, there are 2, 16, and 256 entries respectively; When biBitCount=24, there is no Color table entry.

The bitmap information header and color table constitute the bitmap information. The BITMAPINFO structure is defined as follows: typedef struct tagBITMAPINFO { BITMAPINFOHEADER bmiHeader; Bitmap information header RGBQUAD bmiColors[1]; Color table} BITMAPINFO; 4. Bitmap Data: Bitmap data records each pixel value of the bitmap. The recording order is from left to right within the scanning line and from bottom to top between scanning lines.

The number of bytes occupied by one pixel value of the bitmap: When biBitCount=1, 8 pixels occupy 1 byte; When biBitCount=4, 2 pixels occupy 1 byte; When biBitCount=8, 1 Each pixel occupies 1 byte; when biBitCount=24, 1 pixel occupies 3 bytes; Windows stipulates that the number of bytes occupied by a scan line must be a multiple of 4 (that is, in long units). If it is not enough, 0 padding, the calculation method for the number of bytes occupied by a scan line: DataSizePerLine= (biWidth* biBitCount 31)/8; the number of bytes occupied by a scan line DataSizePerLine= DataSizePerLine/4*4; the number of bytes must be 4 The size of multiple bitmap data (without compression): DataSize= DataSizePerLine* biHeight; 2. BMP file analysis 1. Tool software: Hex Workshop or UltraEdit 2. Analysis: First of all, please note that all values ??are stored as " "The principle of putting high bits in high bits and putting low bits in low bits", for example, 12345678h is 7856 3412 when placed in memory).

The picture below is a picture of hexadecimal data, which is used as an example for analysis. In order to simplify the description during the analysis, one word (two bytes as the unit, such as 424D is one word) is used as the serial number unit, and "h" indicates a hexadecimal number.

424D 4690 0000 0000 0000 4600 0000 2800 0000 8000 0000 9000 0000 0100 1000 0300 0000 0090 0000 A00F 0000 A00F 0000 00 00 0000 0000 0000 00F8 0000 E007 0000 1F00 0000 0000 0000 02F1 84F1 04F1 84F1 84F1 06F2 84F1 06F2 04F2 86F2 06F2 86F2 86F2 1: Image file header. 424Dh='BM', indicating that it is the BMP format supported by Windows.

2-3: The entire file size. 4690 0000, which is 00009046h=36934.

4-5: Reserved, must be set to 0. 6-7: The offset from the beginning of the file to the bitmap data.

4600 0000 is 00000046h=70. The above file header is 35 words = 70 bytes. 8-9: Bitmap information header length.

10-11: Bitmap width, in pixels. 8000 0000 is 00000080h=128.

12-13: Bitmap height, in pixels. 9000 0000 is 00000090h=144.

14: The number of bit planes of the bitmap. The value is always 1. 0100 is 0001h=1.

15: Number of bits per pixel. There are 1 (monochrome), 4 (16 colors), 8 (256 colors), 16 (64K colors, high color), 24 (16M colors, true color), 32 (4096M colors, enhanced true color).

T408 supports 16-bit format. 1000 is 0010h=16.

16-17: Compression description: 0 (no compression), 1 (RLE 8, 8-bit RLE compression), 2 (RLE 4, 4-bit RLE compression), 3 (Bitfields, bit field storage ). RLE simply uses the number of pixels and pixel values ??to compress.

T408 uses a bit field storage method, using two bytes to represent a pixel, and the bit field is allocated as r5b6g5.

In the figure, 0300 0000 is 00000003h=3.

18-19: The size of the bitmap data expressed in bytes. This number must be a multiple of 4, which is numerically equal to the bitmap width * bitmap height * number of bits per pixel. 0090 0000 is 00009000h=80*90*2h=36864.

20-21: expressed in pixels/meter.