Back to 课程

Computer-science_A-level_Cie

0% Complete
0/0 Steps
  1. computers-and-components
    6 主题
  2. logic-gates-and-logic-circuits
    2 主题
  3. central-processing-unit-cpu-architecture
    6 主题
  4. assembly-language-
    4 主题
  5. bit-manipulation
    1 主题
  6. operating-systems
    3 主题
  7. language-translators
    2 主题
  8. data-security
    3 主题
  9. data-integrity
    1 主题
  10. ethics-and-ownership
    3 主题
  11. database-concepts
    3 主题
  12. database-management-systems-dbms-
    1 主题
  13. data-definition-language-ddl-and-data-manipulation-language-dml
    1 主题
  14. computational-thinking-skills
    1 主题
  15. algorithms
    14 主题
  16. data-types-and-records
    2 主题
  17. arrays
    2 主题
  18. files
    1 主题
  19. introduction-to-abstract-data-types-adt
    1 主题
  20. programming-basics
    1 主题
  21. constructs
    2 主题
  22. structured-programming
    1 主题
  23. program-development-life-cycle
    2 主题
  24. program-design-
    2 主题
  25. program-testing-and-maintenance
    3 主题
  26. user-defined-data-types
    1 主题
  27. file-organisation-and-access-
    3 主题
  28. floating-point-numbers-representation-and-manipulation
    3 主题
  29. protocols
    2 主题
  30. circuit-switching-packet-switching
    1 主题
  31. processors-parallel-processing-and-virtual-machines
    5 主题
  32. boolean-algebra-and-logic-circuits
    4 主题
  33. purposes-of-an-operating-system-os
    3 主题
  34. translation-software
    3 主题
  35. encryption-encryption-protocols-and-digital-certificates
    3 主题
  36. artificial-intelligence-ai
    4 主题
  37. recursion
    1 主题
  38. programming-paradigms
    4 主题
  39. object-oriented-programming
    7 主题
  40. file-processing-and-exception-handling
    2 主题
  41. data-representation
    5 主题
  42. multimedia
    3 主题
  43. compression
    2 主题
  44. networks-and-the-internet
    11 主题
课 Progress
0% Complete

Bitmap encoding

What is a bitmap?

  • A bitmap image is made up of squares called pixels

  • A pixel is the smallest element of a bitmap image

  • Each pixel is stored as a binary code

  • Binary codes are unique to the colour in each pixel

  • A typical example of a bitmap image is a photograph

Blue rectangular electronic sensor with grid openings and four metal pins on the bottom for connectivity, casting a shadow on a white surface.
Humidity sensor bitmap image
  • The more colours and more detail in the image, the higher the quality of the image and the more binary that needs to be stored

Image vs screen resolution

  • Image resolution is the total amount of pixels that make up a bitmap image

  • The image resolution is calculated by multiplying the height and width of the image (in pixels)

  • In general, the higher the resolution the more detail in the image (higher quality)

  • Screen resolution refers to the total amount of pixels horizontally in a display, such as:

    • Computer monitors – 1440p means 1440 pixels horizontally compared to 4K which is 3840 pixels (roughly 4 thousand)

    • TVs – HD (high definition) televisions have a screen resolution of 1080p, 1080 pixels horizontally compared to newer 4K televisions with 3840 pixels

    • YouTube – The quality button allows a user to change the video playback resolution from 144p (144 pixels horizontally) up to 4K

  • Another consideration of screen resolution is the physical size of the of the display

  • The number of pixels per square inch (PPI) is known as pixel density

  • Pixel density can mean images to need to be scaled up or down to fit, sometimes causing loss in quality

Case Study

  • A consumer purchases a new 65″ 4k television

  • The screen resolution is 3840 x 2160

  • To calculate the pixel density of the screen we add together the squares of the resolution

    • (38402 + 21602) = (14 745 600 + 4 665 600) = 19 411 200

    • Find the square root (square root of 19 space 411 space 200 end root = 4405.814)

    • Divide by the screen size (4405.814 / 65 = 68)

  • The television has a pixel density of 68 pixels per inch (PPI)

  • Watching 4K content from a normal viewing distance means the image will appear crisp and sharp

  • However, if you sit too close, you may start to see:

    • The pixel grid

    • A loss of fine detail

  • Modern smartphones have very high screen resolutions in much smaller screens

  • This gives them a much higher PPI, often over 300 PPI

  • This means they can be viewed up close without losing quality or seeing pixelation

Colour/bit depth

  • Colour depth is the number of bits stored per pixel in a bitmap image

  • The colour depth is dependent on the number of colours needed in the image

  • In general, the higher the colour depth the more detail in the image (higher quality)

  • In a black & white image the colour depth would be 1, meaning 1 bit is enough to create a unique binary code for each colour in the image (1=white, 0=black)

Example 1 bit black and white image
  • In an image with a colour depth of 2, you would have 00, 01, 10 & 11 available binary codes, so 4 colours

Example 2 bit Mario image
  • As colour depth increases, so does the amount of colours available in an image

  • Colour depth can also refer to the number of colours that can be represented in an image

  • It is calculated using the formula:

    • Colour depth = 2n (where n = number of bits)

Colour/bit depth

Number of colours

Example

1 bit

21 = 1

B&W

2 bit

22 = 4

Icons/logos

4 bit

24 = 16

Early computer graphics

8 bit

28 = 256

GIFs, retro games

24 bit (True colour)

224 = 16 777 216

High-quality images

Calculating the size of a bitmap file

How do you calculate the size of a bitmap image?

  • Estimating the size of a bitmap image can be carried out with the following formula:

    • Resolution x colour/bit depth

Example

Image Files

(Resolution) x (Colour Depth)

Size of bitmap image = 

 

 

Resolution

250,000

Resolution = width x height

Colour depth

24 bits

24 bits = 3 bytes

250,000 x 24

=

(bit to bytes) /8

(bytes to KiB) /1024

or

(bytes to KB) /1000

6,000,000 bits

750,000 bytes

732 KiB

or

750 KB

250000 x 3

=

(bytes to KiB) /1024

or

(bytes to KB) /1000

750,000 bytes

732 KiB

or

750 KB

  • When bitmap images are saved, a file header is created

  • This contains:

    • File type (.bmp or .jpg)

    • File size

    • Image resolution

    • Colour depth

    • Any type of compression if used

Worked Example

The following section of a bitmap image is 10 pixels wide and 5 pixels high. In this example, each colour is represented by a letter, e.g. O is orange.

The complete image can have up to 256 colours

<img alt=”A grid of letters with ten columns and six rows containing letters B, Y, R, M, P, K, T, G, and O in various sequences and positions.” class=”ContentBlock_figure__vJw2q” data-nimg=”1″ decoding=”async” height=”207″ loading=”lazy” sizes=”(max-width: 320px) 320w, (max-width: 640px) 640w, (max-width: 960px) 960w, (max-width: 1280px) 1280w, 1920w” src=”https://cdn.savemyexams.com/cdn-cgi/image/f=auto,width=3840/https://cdn.savemyexams.com/uploads/2025/04/6997_screenshot-2025-04-02-113659.png” srcset=”https://cdn.savemyexams.com/cdn-cgi/image/f=auto,width=16/https://cdn.savemyexams.com/uploads/2025/04/6997_screenshot-2025-04-02-113659.png 16w, https://cdn.savemyexams.com/cdn-cgi/image/f=auto,width=32/https://cdn.savemyexams.com/uploads/2025/04/6997_screenshot-2025-04-02-113659.png 32w, https://cdn.savemyexams.com/cdn-cgi/image/f=auto,width=48/https://cdn.savemyexams.com/uploads/2025/04/6997_screenshot-2025-04-02-113659.png 48w, https://cdn.savemyexams.com/cdn-cgi/image/f=auto,width=64/https://cdn.savemyexams.com/uploads/2025/04/6997_screenshot-2025-04-02-113659.png 64w, https://cdn.savemyexams.com/cdn-cgi/image/f=auto,width=96/https://cdn.savemyexams.com/uploads/2025/04/6997_screenshot-2025-04-02-113659.png 96w, https://cdn.savemyexams.com/cdn-cgi/image/f=auto,width=128/https://cdn.savemyexams.com/uploads/2025/04/6997_screenshot-2025-04-02-113659.png 128w, https://cdn.savemyexams.com/cdn-cgi/image/f=auto,width=256/https://cdn.savemyexams.com/uploads/2025/04/6997_screenshot-2025-04-02-113659.png 256w, https://cdn.savemyexams.com/cdn-cgi/image/f=auto,width=384/https://cdn.savemye

Responses

您的邮箱地址不会被公开。 必填项已用 * 标注