
Bitmaps and pixel maps are digital representations of images where each pixel’s color value is stored in memory .
Bitmaps and pixel maps are digital representations of images where each pixel’s color value is stored in memory.
Reading and writing refers to the process of importing image data into memory and exporting it from memory to storage or display.
A standard bitmap image consists of:
Header
Color Table (optional)
Pixel Data
Each pixel can be represented in different ways:
To read a bitmap into memory:
open("image.bmp", "rb")
read header -> width, height, color depth
read color table (if exists)
for each row:
read pixel data into array
To write a bitmap from memory:
open("output.bmp", "wb")
write header
write color table (if needed)
for each row in pixel array:
write pixel data to file
A pixel map is similar to a bitmap but may use other formats like PNG, TIFF, or custom pixel buffers.
Reading/Writing pixel maps involves:
| Operation | Purpose | Key Steps |
|---|---|---|
| Reading bitmap | Load image into memory | Read header → Color table → Pixel data |
| Writing bitmap | Save image from memory | Create header → Write color table → Write pixel data |
| Pixel map | General image buffer | Store/modify pixels for rendering |
Key Points:
Open this section to view and download past papers
Click on Show Past Papers to load available exam papers.