Vector graphic VS bitmap image

Vector graphic

  1. A vector graphic file contains a drawing list.
  2. The list contains a command for each object included in the image
  3. The objects are defined by geometrical formula and associated properties, such as line color and style.
  4. When a vector graphic need to be magnified, the file is read, the appropriate calculations are made and the objects are redrawn to a suitable scale.
  5. This means that vector graphic is scalable. The image would not get blur or distorted when magnified.

Bitmap image

  1. A bitmap image is made up of pixels (picture elements)
  2. A pixel can be imagined as a single dot.
  3. Each pixel has a color. The number of bits used to represent the color is called bit depth.
  4. The pixels of a bitmap image are organized in a matrix.
  5. The number of columns multiplied by the number of rows of the matrix is referred to as the image resolution.
  6. Bitmap images are not scalable. this means when they are over magnified, they might be blur or distorted.
  7. Estimation of the file size of a bitmap file:
    1. Calculate the number of pixels of the image. This is indicated by the image resolution
    2. Multiply the number of pixels by the bit depth to get the file size in bits
    3. Write the file size with appropriate units, MiB, GiB, etc. Special attention needs to be paid to the difference between the upper-case B(Byte, 8 bits) and lower-case b(byte).
  8. Last but not least thing is bit depth. How many bits should be used to represent the color of each pixel? It depends on the number of colors in the image. For example, if there are 256 different colors in a bitmap image, 8 bits can be used to represent the color, because 8 bits can represent 2^8=256 colors. Another example, if there are 63 colors in a bitmap, then 6 bits at least has to be used to represent all the colors. 5 bits can only represent 2^5= 32 colors, not enough. 6 bits can represent 2^6=64 colors. So, the most appropriate bit depth for a 63 colors bitmap image is 6 bits, even though 64 > 63.
发布了22 篇原创文章 · 获赞 6 · 访问量 35万+

猜你喜欢

转载自blog.csdn.net/zhangxingping/article/details/104027505
今日推荐