Storing Images

Cards (13)

  • What are bitmap images
    • Most images you use are bitmap images (e.g. photos) and they are made out of pixels arrange on a grid 
    • Pixels are tiny , single-colour squares/dots
  • The colour of pixels
    • Each pixels is assigned a binary code/value which represents the colour of that pixel 
    • The number of colours available in an image is related to the number of bits the code has - you can make a greater range of shades and colours by increasing the number of bits for each pixel
  • 1-bit images and 2-bit images
    • Black-and-white images only use 2 colours, so they only need 1-bit for each pixel 
    • White is represented by 0 , and black is represented by
    • 2-bit images can be made up of 4 colours , and each pixel can be one of 4 binary values , 00 , 01 , 10 and 11
  • What are vector images
    • Vector images are images drawn by the computer following precise mathematical instructions to create lines and objects 
    • Vector images are usually smaller in file size compared to bitmap images because each pixel in a bitmap image is stored as an individual binary value 
  • What is colour depth
    • Colour depth is the number of bits used for each pixel 
    • Given the colour depth, you can work out how many colours can be made using this formula - total number of colours = 2ⁿ (Where n = number of bits per pixel) 
    • Most devices use a 24-bit colour depth, with 8 bits for the levels of red, green and blue in each pixel 
    • This colour depth can produce more colours than the human eye can see (estimated to be 10 million)
  • What is the total number of colours in a 1-bit image
    2 colours
  • What is the total number of colours in a 2-bit image?
    16 colours
  • What is resolution
    • The image resolution is the number of pixels in the image (It’s sometimes given as width x height) 
    • The higher the resolution , the more pixels the image is made of, so the better the quality of the image 
  • What is the number of colours in a 24-bit image
    16,777,216 colours
  • How to work out file size in bits
    • To work out how many bits an image will take up , use the formula :
    • File size (in bits) = width x height x colour depth
  • Calculate the file size, in MB of an 8-bit image that is 2000 pixels wide and 1000 pixels high?
    • Find the image resolution of image (width x height) - 2000 x 1000 = 2,000,000 
    • Find the colour depth of the image - Image has 8 bits, so the colour depth of 8 
    • Multiply the image resolution by the colour depth, to get file size in bits, - 16,000,000 
    • Divide 16,000,000 bits by 8 to convert it into bytes (8 bits in 1 byte), - 2,000,000 bytes 
    • Divide 2,000,000 bytes by 1000 twice to convert to MB (B > KB > MB) to get a final answer of 2 MB
  • Calculate the resolution of the image below (Hint: count the pixels to find width and height)
    48 bits
  • Calculate the file size in KB of this 1 bit image
    • By counting, you can see the width = 8 and the height = 6  - Resolution = 48 
    • The colour depth is 1 bit (The image is 1-bit and only has 2 colours) 
    • File size in bits = resolution x colour depth = 48 
    • File size in bytes = 48 divided by 8 = 6 bytes
    • File size in KB = 6 divided by 1000 = 0.006 KB