1.2 Representing Characters, Images & Sounds

Aims

  • Describe how characters are used in a character set and the difference between ASCII and UNICODE.

  • Describe how images are stored in a computer system, the difference between bitmap and vector images and how to calculate image file sizes.

  • Describe how sound is stored in a computer system.

Every key on a keyboard is converted into binary using a character set

Character sets are agreed - all computers must understand the character set to transfer info between them.

ASCII - American Standard Code Information Exchange

Two versions - ASCII (7 bits, max 128 char 0-127) and extended ASCII (8 bits, 256 char 0-255)

  • Codes are sequential e.g A is 65 then C is 67

  • Pattern applies to digits and lowercase letters

  • ASCII code values are different from pure binary value so you cant calculate with numbers input as strings

Unicode - Universal Encoding

Standard character set used for representing characters for all languages in the world including ones with symbols i.e. Chinese, Arabic, Japanese and Greek

Uses between 8 and 32 bits per character - originally 16 bits now 24 bit (converted to Hex)

ASCII

Extended ASCII

Unicode

Number of bits

7 bits

8 bits

8-16 bits (can go up to 32)

Number of characters

128

256

65,536 (16 bit)

Benefits

Each character stored uses 7 bits which uses less storage space

Each character stored uses 8 bits which uses less storage space

  • It can represent more characters than ASCII

  • It supports all common characters across the world

  • It can store emoji’s

Cons

  • Represents less characters

  • Can’t support all common characters worldwide

  • Cant store emoji’s

  • Represents less characters

  • Cant support all common characters worldwide

  • Cant store emoji’s

  • Each character is stored using 16 bits which uses more storage space


Representing Images

Bitmap

Made up of Pixels (dot)- aka PICture ELement and is smallest area of an image

Each pixel is one colour and has a binary code for it, when many pixels are combined they make an image

Colour depth is the number of bits used to represent colours in a pixel - greater the colour depth the greater the number of colours can be used

1 bit=2 colours, 2 bits=4 colours, 3 bits=8 colours etc

Image resolution is the detail amount that an image holds, usually measured in pixels per inch (number of pixels to make up an image)

Screen resolution is the number of pixels a display can show in width (horizontal) and height (vertical), determines clarity and sharpness e.g. 1920 × 1080

File size influence: colour depth- increasing colour depth increases bits used per pixel and therefore stored and resolution - greater the resolution the more pixels per inch meaning the more binary codes stored per inch. Increase both=increased file size.

Image quality influence: colour depth- increasing colour depth means more colours can be used and resolution-increases the number of pixels per inch making the image less pixelated, Increase both=increased quality.

Meta data is data about data e.g resolution, width by height, colour depth, date and time image created and location where image was taken etc.

File header: at beginning of file to help identify file format - used by software applications and operating systems to determine the format and how to interpret its contents

File storage calculation

Image file size in bits=colour depth x image height (px) x image width (px)

e.g. 4×2056×3092=25428608 bits /8=3178576 bytes/1000=3178.576 kilobytes

Vectors (SVG -Scalable Vector Graphics)

  • Image made up of geometric shape

  • Vector object made up of vector paths

  • can be resized without issue due to mathematical relationship (no quality loss)

  • Possible to edit each object property separately e.g. change shape/stroke/fill/size/position

  • Stroke is outline of the vector path

  • Fill is the colour to the area inside the path (think shapes in Microsoft Word)

  • Stores only necessary details to recreate shape e.g. a circle would need position, radius, etc.

  • Has a smaller file size than bitmap

  • Needs a drawing list to store the order the objects are to be created in

  • The order is called layers- back layer must be drawn first and front layer drawn last

  • Con - never as lifelike as bitmap and will always appear computer generated

  • Con - Cant be used to store photos from a digital camera

Representing Sound

Analogue sound is what we hear in the real world

Computers cant store analogue sound so it must be converted to digital

To convert it samples need to be taken and then each sample is stored in binary

Sample: Reading/measurement taken at certain points and stored in binary - measured in Hertz (Hz)

Sample Rate/Frequency: how many times a sound is sampled every second

Bit rate/depth: number of bits used to store each sample - the more bits used the more sounds (amplitude levels) can be created e.g. 4 bits= 16 different sounds etc.

Sample Internal: time between each sample

Duration: How many seconds of audio the sound file contains

File size influence: Sample rate-samples are stored in binary, therefore the more samples taken the more information that needs to be stored, Bit Depth- increasing bit depth means more sounds and therefore more bits need to be stored for each sample, increase both=increased file size.

Sound quality influence: Sample rate- when the file is converted from analogue to digital, parts of the sound file are lost however the more samples you have decreases the amount of parts lost and thus increasing quality, Bit depth- an increase in bit depth means more unique codes available and therefore more sounds can be generated to give better quality sound.

Human sound range is between 20Hz-20KHz - so 16 bits is usually enough