General information about the picture to understand its nature. The concept of picture size, pixels, bitmaps, etc. is summarized as follows:
- The size of the picture in the computer
- The total size of the picture = total pixels of the picture * the size of each pixel (the total pixels of the picture = pixel size, which is the resolution, such as setting 800*400) (the size of each pixel is different), which causes the total size of the picture to be different.
- Monochrome bitmap: can only represent 2 colors
- Use two numbers: 0 and 1
- Using a binary number with a length of 1 can represent the
- 1/8 bytes per pixel
- Total size = Total pixels of picture * size per pixel =320000/8=40000 bytes (view picture information with basic match)
- 16-color bitmap: Capable of representing 16 colors
- Requires 16 numbers: 0-15,0000-1111
- Using a binary array of length 4 can represent the
- Consumes 4/8=1/2 bytes per pixel
- Total size = Total pixels of the picture * the size of each pixel occupies =320000/2=160000 bytes
- 256-color bitmap: Capable of representing 256 colors
- Requires 256 numbers: 0-255,0000 0000-1111 1111
- Use a binary number of length 8
- Consumes 8/8=1 bytes per pixel
- Total size = Total pixels of the picture * the size of each pixel occupies =320000*1=320000 bytes
- 24-bit bitmap:
- Each pixel occupies 24 bits, which is "3 bytes", so it is called a 24-bit bitmap.
- Total size = Total pixels of the picture * the size of each pixel occupies =320000*3=960000 bytes
- Another way of understanding:
- r:0-255, requires a binary digit length of 8, takes 1 bytes
- g:0-255, requires a binary digit length of 8, takes 1 bytes
- b:0-255, requires a binary digit length of 8, takes 1 bytes
Android Beginner Tutorial Picture information