Want to create interactive content? It’s easy in Genially!

Get started free

IGCSE CS Topic 1

Kirsty Rogers

Created on May 2, 2024

Start designing with a free template

Discover more than 1500 professional designs like these:

Transcript

Data

Image, Text and Sound Representation

File Compression

Data Storage Units

Choose an area to revise

Text Representation

Image Representation

Sound Representation

Image Representation

File Formats

Metadata

Representing Colour

What is image representation

Ready to Quiz

What is image representation?

Computers work in binary . All data must be converted into binary in order for a computer to process it. Images are no exception. To a computer an image is nothing more than a series of ones and zeros which allow the display of pixels in various colours. A pixel is the smallest identifiable component of a bitmap image. Each pixel is allocated a colour code which is representable in binary. In many images, the pixels are too small for the human eye to see, so the colours appear to merge together. Image quality is affected by the resolution of the image. Image resolution is the number of pixels in a specific area of an image. It is expressed as dots per inch (dpi), or pixels per inch (ppi), eg: 72dpi = 72 dots per inch 200 ppi = 200 pixels per inch In a low-resolution image, the pixels are larger and therefore, fewer are needed to fill the space. This results in images that look blocky or pixelated. An image with a high resolution has more pixels, so it looks a lot better when it is enlarged or stretched. The higher the resolution of an image, the larger its file size will be.

Representing colour

Many images need to use colours. To add colour, morebits are required for each pixel. The number of bits determines the range of colours. This is known as an image's bit (colour) depth. For example, using a bit depth of two, ie two bits per pixel, would allow four possible colours, such as: 00 - black 01 - dark grey 10 - light grey 11 - white Each extra bit doubles the range of colours that are available: one bit per pixel (0 or 1) - two possible colours two bits per pixel (00 to 11) - four possible colours three bits per pixel (000 to 111) - eight possible colours four bits per pixel (0000 to 1111) - 16 possible colours 16 bits per pixel (0000 0000 0000 0000 to 1111 1111 1111 1111) - over 65,000 possible colours. The more colours an image requires, the more bits per pixel are needed. Therefore, the more the colour depth, the larger the image file will be.

Metadata

Files contain extra data called metadata. Metadata includes data about the file itself, such as: - file type - date created - author An image file also includes metadata about the image data itself, such as: -the height and width of the image -the resolution -the colour depth Without this metadata, the image data would not be correctly interpreted, meaning the image could not be correctly displayed.

File Formats

There are many different type of images and each format has its unique attributes as follows: JPEG or JPG : Joint Photographic Expert Group, a jpeg image has been compressed from its original size. The compression type is lossy, meaning it does loose some of its quality during compression. JPGs are good for photographs that require good quality images but a small data storage size, such as a photograph being used on a website. Some other popular image file types include. PNG: PORTABLE NETWORK GRAPHICS - Supports good quality graphics with 24BIT representation and designed to work well online through web-browsers. GIF: GRAPHICS INTERCHANGE FORMAT - Normally not compressed and can retain features such as background transparency. The File can be large due to lack of compression. Compatible with many platforms. BMP: BITMAP - Normally not compressed and therefore often maintain good quality but can take up more file space.

Spin the wheel!

Image Representation

WHEEL of awesomeness

0 POINTS

FOR 25 POINTS

An image is made from lots of different coloured squares, each square having a binary value is a...

Bitmap

Vector

Pixel

25 POINTS

RIGHT!

Keep spinning the wheel!

25 POINTS

FOR 100 POINTS

How many colours can be stored with a 5-bit colour depth?

10

32

125 POINTS

RIGHT!

Keep spinning the wheel!

125 POINTS

FOR 75 POINTS

What would be the result of increasing the colour depth of an image?

Decrease file size

Faster loading time

Increase file size

200 POINTS

RIGHT!

Keep spinning the wheel!

200 POINTS

FOR 250 POINTS

An image is 100 pixels wide and 200 pixels tall. It uses 200 different colours. What is the file size in kB to the nearest whole number?

160,000

20

20,000

450 POINTS

RIGHT!

Keep spinning the wheel!

450 POINTS

FOR 50 POINTS

How many bits are needed to show the number of colours the average human can see?

24

28

32

500 POINTS

FOR 500 POINTS

What is additional data stored alongside the image to define the width, height, colour depth and colour palette?

Mega data

Meta data

Image data

1000 POINTS

CONGRATULATIONS!

Choose your prize:

Pet

Box

Travel

1000 POINTS

CONGRATULATIONS!

Choose your prize:

Pet

Box

Travel

1000 POINTS

CONGRATULATIONS!

Choose your prize:

Pet

Box

Travel

THE BOX IS EMPTY

1000 POINTS

CONGRATULATIONS!

Choose your prize:

Pet

Box

Travel

TRY AGAIN!

Text Representation

Unicode

Extended ASCII

ASCII

What is text representation

Ready to Quiz

What is text representation?

Computers work in binary. All data must be converted into binary in order for a computer to process it. Text is no exception. Computers represent text using character sets, which are sets of characters and symbols that are assigned a unique binary code that can be understood by the computer. The use of character sets is important because it enables computers to store and display text in a standardized way, regardless of the language or alphabet used. Every time you press a key on the keyboard it sends a signal containing the binary sequence for the chosen key. This is sent using the buses to allow it to be displayed on the screen. Your course requires you to have an understanding of three of these:- ASCII- Extended ASCII - Unicode

ASCII

One of the most widely used character sets is the American Standard Code for Information Interchange (ASCII), which was developed in the 1960s for use with early computers. ASCII is widely used in the US, and is also used as a base for other character sets in different parts of the world. ASCII uses seven bits, giving a character set of 128 characters. The characters are represented in a table, called the ASCII table. The 128 characters include:32 control codes (mainly to do with printing) 32 punctuation codes, symbols, and space 26 upper case letters 26 lower case letters numeric digits 0-9 We tend to say that the letter ‘A’ is the first letter of the alphabet, ‘B’ is the second and so on, all the way up to ‘Z’, which is the 26th letter. In ASCII, each character has its own assigned number. For example: As computers became more advanced and widespread, it became clear that the 128 characters of ASCII were not sufficient to represent all the characters and symbols used in different languages and scripts around the world.

Extended ASCII

Extended ASCII provides an extra bit and therefore an extra 128 characters. represents both control characters and printable characters. Control characters are used to perform actions rather than to display a printable character on screen. Easily understood examples include 'Escape', 'Backspace' and 'Delete'. Printable characters are used to show a character on screen. Letters, symbols, numbers and punctuation marks are all examples of printable characters. Although it provided for more representation it still lacked the capacity to support languages globally and so a further solution was required.

Unicode

While Extended ASCII was suitable for representing English characters, 256 characters is far too small to hold every character in other languages. Unicode was developed in the 1990s as a universal character set that could represent all characters used in any language or script. Unicode uses 16 bits to represent a total of 65,536 characters, including characters from different scripts such as Latin, Arabic, Chinese, and many more. Unicode has become the standard for representing text in modern computing, and most modern operating systems, applications, and programming languages support Unicode. The use of Unicode has enabled the development of software and applications that can display text in different languages and scripts, which has been important for global communication and accessibility. Whilst Unicode allows more languages to be represented and the use of emojis its extra use of bits does mean it requires more storage space and so there may be situations where ASCII or extended ASCII are more suitable.

Text RepresentationDarts

Start

What is the base number system used in binary encoding?

10

16

Yeah!

Next question

What is a character set?

A system to encrypt data

A formula for text compression

Unique binary codes for text

Yeah!

Next question

How many bits does the original ASCII character set use?

16

Yeah!

Next question

Which form of text representation caters effectively for many different languages across the world?

Extended ASCII

Unicode

Binary

Yeah!

Next question

What is the benefit of extended ASCII over traditional ASCII?

Encodes more characters

Uses fewer bits

They are identical

Yeah!

Next question

How many characters can be represented by extended ASCII?

1024

128

256

Yeah!

Next question

Why might someone choose to use ASCII encoding over Unicode?

ASCII uses less storage space

ASCII has more characters

Unicode is less compatible

Yeah!

Next question

What is the primary reason for using character sets in computing?

Increase processing speed

Standardise the representation of text

Improve user interface

Yeah!

Next question

In ASCII which characters were reserved for special characters and computer instructions?

129-255

0-30

100-127

Yeah!

Next question

Which character in ASCII was a new line character, which is why you often have to use commands like strip in programming when reading data from files to remove or strip these from the ends of lines of text?

13

Yeah!

Results

Oh no!

Try again

Results

0-4 Correct

5-7 Correct

8-10 Correct

Image Representation

Sound Representation

File size calculation

Bit rate and bit depth

Sampling

What is sound representation?

Ready to Quiz

What is sound representation?

Sound is vibrations that oscillate in wave forms creating a change in pressure. Each wave is defined as a frequency which is measured in hertz. The amplitude of the sound wave is first determined at set time intervals. The value is converted to digital form. Each sample of the sound wave is then encoded as a series of binary digits. A series of readings gives an approximate representation of the sound wave

Sampling

Sampling Resolution: The number of bits per sample is known as the sampling resolution (aka bit depth) Increasing the sampling resolution increases the accuracy of the sampled sound as more detail is stored about the amplitude of the sound. Increasing the sampling resolution also increases the memory usage of the file as more bits are being used to store the data. Sampling Rate The sampling rate is the number of sound samples taken per second, which is measured in Hertz (Hz) A higher sampling rate would allow more accurate sound as fewer estimations will be done between samples.

Bit rate and depth

Bit depth Bit depth refers to the number of bits used to record each sample. Just as with images, the higher the bit depth, the more accurately a sound can be recorded, but the larger the file size. Typical bit depths are 16 bit and 24 bit. Bit rate Bit rate is simply a measure of how much data is processed for each second of sound. Bit rate is calculated by: Sample rate × bit depth As with sample rate, the higher the bit rate, the better quality of the recorded sound.

File Size Calculation

Samples per second x bits per second x time (in seconds) or Sample Rate X Bit Depth X Time Example 10,000(samples per second) X 16 (bit depth) X 60 (seconds) = 9,600,000 bits The result for the example above is shown in bits but, it would be more appropriate to show the results in bytes, megabytes. To convert to a more appropriate representation, firstly you would divide by 8 to see how many bytes and then by 1024 for Kb and 1024 for Mb and so on... 9,600,000 / 8 = 1,200,000 Bytes 1,200,000 / 1024 = 1171.875 Kilo Bytes 1171.875 / 1024 = 1.14 Mega Bytes 1.4Mb is a much more appropriate term to use for the representation of the file size example above. The above example presumes that the audio output is mono (the exact same sound is being sent to each speaker. Currently sound representation is at very least recorded in stereo, meaning that the left and right speaker work independently, if the sound is stored in stereo then the file size should be double. With larger home audio system a 5.1 representation could be expected, in this care each speaker has its independent sound track, Front Left, Front Center, Front Right, Rear Left, Rear Right and separate base speaker (subwoofer), in this case 6 channels may be needed so the file size could be 1.14Mb X 6. Most recordings are also made using a frequency of 44.1kHz.

Sound Ninja QUIZ

start

Question 1/10

Soundwaves can be defined as...

Vibrations in the air

Noises we hear

How computers hear sound

Question 2/10

What specifies the loudness of a sound?

Frequency

Wavelength

Amplitude

Question 3/10

The sounds we hear where the sound wave varies continuously is known as...

Analogue

Digital

Auditory

Question 4/10

What is the process of measuring the amplitude of a sound?

Snipping

Sampling

Converting

Question 5/10

Which axis shows the amplitude of the sampled sound on a graph of a sound wave?

Question 6/10

What can be defined as the number of bits used to represent sound amplitude in digital sound recording?

Sample rate

Sample resolution

Sample depth

Question 7/10

What is defined as the number of sound samples taken per second in digital sound recording?

Sample resolution

Sample depth

Sample rate

Question 8/10

How do you calculate the file size of a song?

Sample rate x sample resolution x length

sample resolution x length

(Sample rate x sample resolution) / length

Question 9/10

An audio file has a sample rate of 44100 and a sample resolution of 16 bits. The music is being sampled in stereo. Calculate the file size for a 1 hour recording in MiB.

635040000

605

5080320000

Question 10/10

Which of these file formats is used when storing and compressing sound files?

RLE

JPEG

MP3

wrong

YOU DIDN'T FOLLOW THE WAY OF THE NINJA

Try again

YOU'REA NINJA!

Choose a new topic

Data Storage

Units of Data Storage

Image File Calculation

Sound File Calculation

Ready to Quiz

Units of Data Storage

Measurement of data storage

A bit is the basic unit of all computing memory storage terms and is either 1 or 0. The byte is the smallest unit of memory in a computer - 1 byte is 8 bits. A 4 bit number is called a nibble. Remember when eating a sandwich you have a bit, then a nibble then a bite! 1 byte wouldn't get you very far and so there are names for larger collective numbers of bits. There are two methods to learn - the more inaccurate version where based on the SI system of units 1 kilo equals 1000. The other measures in powers of 2 and has beenn adopted by the IEC and is based on the binary system.

Image File Size Calculations

Find the resolution of the image

Times the pixels in height by the pixels in width

Calculate the colour depth in bits

How many bits will it take to represent all the colours? For example 2 bits shows 4 colours, 4 bits shows 16 colours and 7 bits shows 256 clolours

Multiply resolution by colour depth

This will give you the value in bits

Check the question parameters

Does it want just one image converted? Does it want the answer in MiB?

Calculate the file size

If more than one image is being represented multiple the size for one image by the number of imagesIf the answer requires another unit divide the answer by 8 to get into bytes and then convert to the correct unit

Sound File Size Calculations

Find the sample rate in Hz

This is likely to be 44100 unless specified

Multiply by the sample resolution

How many bits will it take to represent all the sounds? Make sure it is in bits

Multiply by the length of the sample

Ensure it is in seconds e.g to use a 3 minute 40 second song we calculate (3 x 60) + 40 to get 220s

Check how the song is recorded

If it is in mono use the calculation above. If it is in stereo this records with two channels so double the size.

Calculate the file size

If the answer requires another unit divide the answer by 8 to get into bytes and then convert to the correct unit

Data Storage Jigsaw Quiz

Start

Question 1/10

Question 2/10

Question 3/10

Question 4/10

Question 5/10

Question 6/10

Question 7/10

Question 8/10

Question 9/10

Question 10/10

End of the quiz!

Next

Data Compression

Processing power and storage space is very valuable on a computer. To get the best out of both, it can mean that we need to reduce the file size of text, image and audio data in order to transfer it more quickly and so that it takes up less storage space. In addition, large files take a lot longer to download or upload which leads to web pages, songs and videos that take longer to load and play when using the internet. Compression addresses these issues. Any kind of data can be compressed. There are two main types of compression, lossy and lossless.

Types of Compression

Lossless

Lossy

Ready to Quiz

1/5

What is the main aim of compression?

Make it easier to use

Remove parts of the file

Reduce the size of a file

Sesiones de aprendizaje / 02

Correct!

Sesiones de aprendizaje / 02

2/5

Which of these is not a reason for compressing a file?

To save storage space on devices such as the hard disk drive

To reduce costs by limiting the size of cloud storage needed to be purchased

To increase the bandwith used when sending image

Ssiones de aprendije / 02

Correct!

Continue

Sesiones de aprendizaje / 02

3/5

Which form of compression works by using an algorithm to look for repeated patterns and then storing these in an index table?

Lossy

Lossless

Sesiones de aprendizaje / 02

Correct!

Continue

Sesiones de aprendizaje / 02

4/5

When reducing a sound file using lossy compression what is removed?

Higher frequencies and dynamic range

Distortions and the length of the track

Volume of the sound

Sesiones de aprendizaje / 02

Correct!

Continue

5/5

Run Length Encoding is an example of...

Audio Lossy Compression

Data Storage Method

Lossless Compression

Awesome!

Correct!

Continue

Congratulations! You have answered everything correctly

new topic

Learning sessions / 02

Wrong!

Try again

Feel like a Genius

(8-10 Correct)

You did great but to get even better you can find resources on Minerva, watch the Craig n Dave series or come along to workshops for help

You should study more...

(0-4 Correct)

You can find resources on Minerva, watch the Craig n Dave series or come along to workshops for help

Lossless Compression

Lossless compression doesn’t reduce the quality of the file at all. No data is lost, so lossless compression allows a file to be recreated exactly as it was when originally created. There are various algorithms for doing this, usually by looking for patterns in the data that are repeated. Zip files are an example of lossless compression. The space savings of lossless compression are not as good as they are with lossy compression.

Not bad!

(5-7 Correct)

To improve further, you can find resources on Minerva, watch the Craig n Dave series or come along to workshops for help

Lossy Compression

Lossy compression removes some of a file’s original data in order to reduce the file size. This might mean reducing the numbers of colours in an image or reducing the number of samples in a sound file. This can result in a small loss of quality of an image or sound file. A popular lossy compression method for images is JPEG, which is why most images on the internet are JPEG images. A popular lossy compression method for sounds is MP3. Once a file has been compressed using lossy compression, the discarded data cannot be retrieved again. It therefore is not useful for compression text files or executable programs.