Login

Please fill in your details to login.





s5cs09 representing and storing bitmap images

This page is mainly about s5cs09 representing and storing bitmap images
image


Ah, yes. A wildly pixelated Ben introduces us to the colourful world of bitmap images and bitmap encoding.

We are learning...

How images are represented in computer systems

So that we can...

Describe how images are represented as bitmaps
State the meanings of resolution, colour depth and image size
- resolution can be expressed as pixel dimensions or pixel density
Calculate storage requirements for images
Discuss metadata that is commonly stored with images.

Activity 1
What is a 'bitmap?'

Images are very efficient ways of representing and communicating information. Human beings are very good at seeing patterns in visual displays. Images include, besides photographs and drawing or paintings, patterned displays of data, mathematical forms and graphs and charts. Images can be altered and manipulated, particularly if in digital form.

Pixels

A digital images consists of a rectangular array or grid of "pixture elements", called pixelsI have no idea what this means. Similarly, a television picture consists of an array of dots of different brightness and colour. A million or more pixels makes up a typical image. You can see individual pixels by looking at a computer screen with a magnifying glass.

image

How a TV Works in Slow Motion - The Slow Mo Guys (11:38)

Task 1.1 Inspect your screen

Using an eye glass, inspect the computer screen. What do you see? Look at different parts of the screen.

image

OUTCOME : Description of a computer screen

A bitmap images is similarly made from individual pixels which are clearly visible if you zoom in on the image.

image

time limit
Task 1.2 Inspecting an image

OK - here it is. You've all been waiting for it and your wait is over. There is an image of Ainsley Harriott for you to download. Open it up with Windows Image Viewer (Right click and Preview) and zoom in as far as you can. Inspect the picture elements which Ainsley is made up from and enjoy.

image

OUTCOME : A close up view of Ainsley

Activity 2
Pixel dimensions and resolution

The term resolutionI have no idea what this means can be, and often is, used incorrectly or inconsistently.

image
Resolution, dummy

Resolution means ...

Pixel dimensions i.e. pixel width x pixel height
Pixel density i.e. the number of pixels per unit length

Pixel density is 'measured' in either ...

Pixels per inch (ppi) for displays
Dots per inch (dpi) for printers and scanner.

time limit
Task 2.1 Auction repair

Visit the Auction repair website, read and make notes. The interesting / relevant bit is at the bottom of the page.

OUTCOME : Notes and possibly diagrams about resolution.

Checkpoint

Activity 3
Colour depth

Each pixel is stored as a number. A bitmap is characterised by the width and height of the image in pixels (the smallest unit on a screen or in memory) and the number of bits per pixel which determines the number of shades of grey or colours it can represent. A typical grey-scale image may have 256 alternative levels of brightness for each pixel and therefore must use one 8-bit byte per pixel to represent its value (28=256)

image

time limit
Task 3.1 How many colours?

How many colours can be represented using the following colour / bit depths?

1 bit per pixel?
2 bits per pixel?
3 bits per pixel?
4 bits per pixel?
8 bits per pixel?
16 bits per pixel?
24 bits per pixel?
n bits per pixel?

OUTCOME : Answers to colour depth problems.

Checkpoint

Whilst it's possible to represent colours in a bitmap using discrete binary codes for each colour, a bitmap representing a coloured image will usually have pixels with eight bits for each saturation level of the red, green, and blue components of the pixel (which is how screens work), though other colour encoding methods are also used.

time limit
Task 3.2 Draw your own bitmap image

Pixie

Use Pixie (or equivalent) to investigate the colours of the pixels on your screen. There are 5 different encoding methods shown for describing the colour of each pixel...

HEX
HTML
RGB
CMYK
HSV

Using suitable examples, explain how each method works.

Super groovy bitmap editor

Using the "Super groovy bitmap editor" (it's a super spreadsheet cause I like spreadsheets), try creating your own bitmap image by encoding the pixel colours by hand. This is a 4 bit / 16 colour image. Try experimenting and changing the colour palette from the one provided and see what you can come up with. The 'ColourNames' tab will help you to choose the colours you want...

image

OUTCOME: Written explanation of how the 5 colour systems work plus a masterpiece drawn pixel-by-pixel.

Checkpoint

If you've managed to play around with the colour palette in the last activity, you should try a little more interactivity with another picture of your favourite chef.

time limit
Task 3.3 Psychedelic Ainsley

Use Adobe Fireworks (or equivalent software) to experiment with altering my colour depth. Make sure you only use the BMP File format and experiment with the colour palette. Use the same image of Ainsley that you used in the previous exercise.

image

Try to make Ainsley look as psychedelic as possible. Try increasing or reducing the colour depth (number of colours) of the image. Make it spicy.

OUTCOME: Psychedelic image of Ainsley Harriott.

Checkpoint

Activity 4
Encoding and decoding images

All bitmap images are encoded as a series of bits. Like any binary string, there is little you can do to interpret the string if you don't know something about the structure of the image.

time limit
Task 4.1 Encoding images

Encoding an image requires knowledge of the colour depth and dimensions required to represent the image. The pixel density (resolution) is not required unless you are printing the image. You are provided with a copy of three different images shown below. Your task is to encode them as bitmaps. For each one, you have to decide firstly on the colour depth required and therefore how many bits per pixel you will need to represent that number of colours. How will you decide which colour to use for each pixel?

image

Q: If each image is to be printed at 4 pixels per inch (an extremely low resolution), what physical size will each image print out at?

image

OUTCOME: Encoded bitmap of each image together, with colour palette if required.

Checkpoint

If you look carefully at the results from the last activity, you'll see that it's impossible to tell where one row ends and another one begins unless you know both...

the colour depth (i.e. how many bits per pixel there are);
the pixel dimensions (there is no guarantee that it will be square).

Also, it's impossible to recreate the image unless you have the colour palette available - how do you know what colour 01001000 represents if you don't have the palette, eh?

Task 4.2 Decoding images

Challenge One

The following bitmap represents a square, 2-colour image. Construct the image in a suitable grid.

0000000001111110010000000100000001011110010000100111111000000000

Challenge Two

The following bitmap represents a 5x7 pixel image consisting of 4 colours. The colour palette is...

00 = Black
01 = Yellow
10 = Green
11 = White

1111111111110000001111010100111101010011111110101111101010101010101010

image

OUTCOME: Nice bitmap images with colours if relevant.

Checkpoint

Activity 5
Calculating file size

image

1
Number of pixels = 800 x 600 = 480,000
2
Bits per pixel = 4 (which allows 16 colours)
3
Total number of bits = 480,000 x 4 = 1,920,000
4
Total number of bytes = 1,920,000 / 8 = 240,000B or 234.375kB or 0.22889MB

The most appropriate file size for this image is 234.375kB as it lies between 1 and 1024. Choose this way, OK?

time limit
Task 5.1 Some for you to try!

Calculate the file size of the following images. Express your answers in the most appropriate file size unit. Write your answers in your books showing your working.

1
1024 x 768 / 4 colours
2
1366 x 768 / 256 colours
3
1920 x 1020 / 16,777,216 colours


image

OUTCOME: Clear file size calculations in your books; with the correct answers.

Checkpoint

Activity 6
Steganography

image

Steganography is the name given to a (fairly) ancient art involving hiding secret messages inside other seemingly plain and non-suspicious text or images.


Task 6.1 Hiding a secret message in a dogs nose.

There are lots of steganography programs out there. OpenStego is free and portable so suits our needs.

image

Investigate how it works and practice sending a secret message to each other using a dog's nose. For added security, you can encrypt the secret message first before you send it so, even if someone figures out that you've hidden the message, they still can't read it without the passcode.
Investigate the limit of the size of file you can hide inside an image? Can you 'see' the effects of the hidden file?

OUTCOME: Description of steganography in your notebooks including examples.

Checkpoint

Activity 7
File formats
There are only a few common bitmap (or raster) file formats which are in use. You might recognise...

JPEG - Joint Photographics Expert Group
TIFF - Tagged Image File Format
GIF - Graphics Interchange Format
BMP - BitMaP
PNG - Portable Network Graphic

Task 7.1 Same image, different format.

Using the image of good old Ainsley, investigate the different file formats that you can export him in. If there are any settings available in each format, experiment with them.

image

OUTCOME: Discussion on filetypes and compression options for file image export.

Checkpoint


The file formats of images do not just contain the bitmap data, they also contain metadata - data about data. The metadata contained in an image file varies depending on how the image was created and what device it was created on.

image
Actually, you can just click on me to view it...


Task 7.2 Metadata


With each picture you have made of Ainsley, upload each one to Jimpl EXIF (Exchangeable Image File Format) Viewer website and inspect the 'metadata' which is stored with each one. You will find that some versions of the picture contain different data which describes it.

Download this really nice picture of Downpatrick Head. It's from an old Summer holiday in Ireland - nice. Upload this to Jimpl and be amazed at how much data it contains apart from the picture. Quite handy if you ever forget where or when you took the photo!

Q: What date is my birthday?

OUTCOME: A list of the common and interesting metadata which is stored in images in your notebook.

Checkpoint

Extension Activities

How about these...

Investigate web-safe colour palette at http://cloford.com/resources/colours/websafe1.htm

Investigate colour schemes at http://paletton.com

Install and use GIMP to produce a simple bitmap image. Print your image out and stick it into your assessment book. Write about what you have done and how you made the image. You should save the image and use a suitable resource to inspect the metadata contained in it. Write about the metadata you have found.

Use an online crossword creator to produce a crossword for the keywords in this topic.

What's next?

Before you hand your book in for checking, make sure you have completed all the work required and that your book is tidy and organised. Your book will be checked to make sure it is complete and you will be given a spicy grade for effort.

END OF TOPIC ASSESSMENT

Last modified: March 21st, 2024
The Computing Café works best in landscape mode.
Rotate your device.
Dismiss Warning