REPRESENTING TEXT, IMAGES AND SOUND

Images

2 types of data compression

Lossless

Lossy

Example:


Compressing an image by decreasing the colour depth

The actual definition of 'Data Compression' is "in which unnecessary data is discarded".

Lossless compression is the process in which you don't lose data.

For example compressing an image by grouping the same colours together.

A computer groups colours together by putting a grid over an image and if there is multiple squares with the same colour, it will put them together.

For example if you have 20 squares of blue, you could group these and instead of having 20 bytes, you have 2 (One for the number of squares and one for the colour).

Pixels

Images need to be converted into binary in order for a computer to process them so that they can be seen on our screen. Digital images are made up of pixels.

Each pixel in an image is made up of binary numbers

If we say that 1 is black (or on) and 0 is white (or off) then a simple black and white picture can be creates using binary

The system described so far is fine for black and white images, but most images need to use four possible numbers will allow an image to use four colours. In binary this can be represented using two bits per pixel.


00 - White
01 - Blue
10 - Green
11 - Red

Adding another binary digit will double the number of colours that are available:


1 bit per pixel (0 or 1): two possible colours
2 bits per pixel (00 to 11): four possible colours
3 bits per pixel (000 to 111): eight possible colours
4 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 number of bits used to store each pixel is called the colour depth. Images with more colours need more pixels to store each available colour. This means that images that use lots of colours are stored in larger files.

Image quality is affected by resolution of the image. The resolution of an image is a way of describing how tightly packed the pixels are.

In a low-resolution images, the pixels are larger so 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 alot better when you zoom in or stretch it. The downside of having more pixels is that the file size will be bigger.

Lossy is the process in which you lose data

Sound

Sound needs to be converted in binary for computers to be able to process it. To do this, sound is captured (usually by a microphone) and that converted into a digital signal.

An analogue to digital converter will sample a sound wave at regular time intervals. For example a sound live this can be sampled at each time sample point.

The samples can then be converted to binary. They will be recorded to the nearest whole number.

If the time samples are then plotted back onto the graph, it can be seen that the sound wave now looks different. This is because sampling does not take into account what the sound wave is doing in between each time sample.

Sound loses quality as data has been lost between the time samples. The way to increase the quality and store the sound at a quality closer to the original, is to have more time samples that are closer together. This way, more detail about the second can be connected to digital and back to analogue again to does not lose as much quality.

Text

When any key on a keyboard is pressed , it needs to be converted into a binary number so that it can be processed by a processed by the computer and the typed character can appear on the screen.

A code where each number represents a character can be used to convert text into binary. One code we can use for this is called ASCII. The ASCII code takes each binary character on the keyboard and assigns it a binary number. For example, the letter "a" has a binary number 0110 0001 (this is the denary number)

Text characters start at denary number 0 in the ASCII code, but this covers special characters including punctuation, the return key and control characters as well as the number keys, capital letters and lower case letters

click to edit