Image
Representation
Schoology: DDMS
Access Code: HF23D-285Z6
How can an image be represented in binary?
Bitmap images
• Bitmap images are made up of individual pixels. The colour of
each pixel is represented as a binary number
• In the example on the right, the animation zooms into the small
image to show the individual pixels.
Binary representations
• The computer has switches to represent data and switches have only two states:
ON and OFF. Binary has two digits to do the counting: 0 and 1 - a natural fit to the
two states of a switch (0 = OFF, 1 = ON).
Hexadecimal and character sets
• Text and numbers can be encoded in a computer as patterns of
binary digits. Hexadecimal is a shortcut for representing binary.
ASCII and Unicode are important character sets that are used as
standard.
Hexadecimal
• Hexadecimal (or hex) is a base 16 system used
to simplify how binary is represented. A hex
digit can be any of the following 16 digits: 0 1 2
3 4 5 6 7 8 9 A B C D E F.
• Each hex digit reflects a 4-bit binary sequence.
• This table shows each hex digit with the equivalent
values in binary and denary.
Hexadecimal: crossword puzzles
• Crossbin puzzles are similar to crossword puzzles except that:
• the clues are hexadecimal numbers, and
• the answers are binary numbers ('0's and '1's) instead of words.
• Also, once the puzzle is complete, if you fill all the '1' squares with black you will see a small picture or pattern.
• Given the hexadecimal clues and a conversion chart like the following:
Hex Binary Hex Binary Hex Binary Hex Binary
0 0000 4 0100 8 1000 C 1100
1 0001 5 0101 9 1001 D 1101
2 0010 6 0110 A 1010 E 1110
3 0011 7 0111 B 1011 F 1111
Hexadecimal: crossword puzzles
Simple example:
• The first Across clue is hexadecimal "2",
which (according to our conversion
chart) is "0010" in binary so that's the
answer we need to insert in the puzzle.
• But we only have 2 squares in which to
write our (4-digit) answer, but that's OK
because any '0's at the beginning of
the number can be removed. So we
chop off the "00" at the beginning and
insert "10" into the puzzle:
Hexadecimal: crossword puzzles
Simple example:
• Next, let's look at the first Down clue:
"11".
• This is a 2-digit hexadecimal number
that we need to convert to binary. We do
this by converting each digit separately
and combining the result:
• hexadecimal "1" becomes binary
"0001", so
• hexadecimal "11" becomes binary
"00010001" ("0001" + "0001")
• We only have 5 squares, so we chop off
the three '0's on the left and insert
"10001" into the puzzle:
Hexadecimal: crossword puzzles
Simple example:
• If we next do [5] Across, we have a clue
of "14" which becomes "00010100"
("0001" + "0100") in binary.
• To fit this in the 6 available squares, we
chop off 2 of the three '0's at the
beginning to produce the answer:
"010100".
• Note that it's OK for crossbin puzzle
answers to begin with a '0'.
Hexadecimal: crossword puzzles
Simple example:
• Looking at [2] Down, we have a clue of
"A" which is "1010" in binary.
• But we have 5 squares in which to write
the answer. Just like it is OK to remove
'0's at the beginning of the number, it is
also OK to add '0's to at the beginning.
So we change "1010" to "01010" and
write that as our answer:
Hexadecimal: crossword puzzles
Simple example:
• Continuing this process, you can
complete the puzzle:
Hexadecimal: crossword puzzles
Simple example:
• Once this is done, you can fill all the '1'
squares with black (and erase the '0'
squares if you like) to produce the final
image: