Presentation is loading. Please wait.

Presentation is loading. Please wait.

Software Design and Development Storing Data Part 2 Text, sound and video Computing Science.

Similar presentations


Presentation on theme: "Software Design and Development Storing Data Part 2 Text, sound and video Computing Science."— Presentation transcript:

1 Software Design and Development Storing Data Part 2 Text, sound and video Computing Science

2 Learning Objectives By the end of this topic you will be able to: understand that text can be stored as ASCII code or as Unicode;understand that text can be stored as ASCII code or as Unicode; understand how computers store graphics as bitmaps understand how computers store graphics as vector graphics; understand how computers store graphics as vector graphics; calculate graphic image file sizes explain the need for data compression; explain how computers store sound data. explain how computers video data.

3 Storing text Text is stored as a series of binary numbers by giving a unique binary code to each character. Need for common standards to allow data transfer between different applications and different computers First common standard used was ASCII

4 What does ASCII stand for? American Standard Code for Information Interchange

5 How does it work? Every character on the keyboard is given a different 7 bit code This gives 128 (2 7 ) possible combinations

6 How does it work? You can convert the ASCII code to a decimal number to make it easier to recognise. The code below is 73 in decimal 64 32 16 8 4 2 U 64 + 8 + 1 = 73

7 How does it work? 128 different possibilities was enough for all the characters on the keyboard and a number of control characters.

8 Control Characters 128 different possibilities was enough for all the characters on the keyboard and a number of control characters. They include tab characters, cursor keys, acknowledgement signals etc. These can be generated by pressing a key with the CTRL key e.g. CTRL-C =return

9 Unicode Now that computers and computer programs are used internationally, there is a need for more than 256 characters to account for foreign alphabets and scripts. UNICODE uses 16 bits to code text, giving 2 16 = 65536 different possible characters

10 Unicode A Unicode character takes up more memory than an ASCII code character. ASCII code = 1 byte per character Unicode = 4 bytes per character ASCII code characters are limited to 128 possible symbols Unicode currently has over 107,000 defined characters

11 Bitmap and vector graphics Images can be stored in two ways As a bitmap graphic As a vector graphic

12 Bitmaps The easiest way to store a graphic is as a set of bits Each bit corresponds to a pixel on the screen which is either on or off (black or white) = 010 101 111 001

13 Resolution Resolution refers to the number of pixels per square inch making up the image

14 Resolution A typical digital camera photograph will be at a much higher resolution than your screen display:

15 Resolution This scanned image takes up 408217KB = approximately 0.5Gb if saved as an uncompressed image

16 Bit-depth Refers to the number of colours used to represent each pixel 1 bit = 2 colours (2 1 =2) 2 bits = 4 colours (2 2 =4) 3 bits = 8 colours (2 3 =8) …….. 24 bits = 16 million colours (RGB)

17 Bit Depth 2 colours = 1 bit 4 colours = 2 bits 8 colours = 3 bits 16 colours = 4 bits 256 colours = 8 bits 65536 colours = 16 bits 16777216 colours = 24 bits

18 Calculating graphic file sizes Information needed: Resolution (dots / pixels per inch) Area of graphic (square inches) Bit depth or number of colours (bits)

19 Calculating graphic file sizes 600 dots per inch 2 X 3 inches 256 colours = 8 bit colour 600 * 600 * 2 * 3 = 2160000 pixels 2160000 * 8 = 17280000 bits = 2160000 bytes = 2109 Kb = 2.05 Mb

20 Calculating graphic file sizes 800 dots per inch 4 X 6 inches 65536 colours = 16 bit colour 800 * 800 * 4 * 6 = 15360000 pixels 15360000 * 16 = 245760000 bits 245760000 / 8 = 3072000 bytes 30720000/1024/1024 = 29.3 Mb

21 Bitmaps Take up a lot of storage space Are quick and easy to calculate Are used by painting and photo editing programs Are easy to compress for transmission over the web:

22 Examples of Bitmap Software Microsoft Paint Corel Paint Adobe Photoshop Paintshop Pro

23 Compressed Bitmaps Graphics files are often very large. To make them easier to store and transmit they are can be compressed. (made smaller) Some compression standards GIF for pictures with large blocks of one colour such as cartoons (lossless) JPG for pictures with detail such as photographs (lossy)

24 Vector Graphics Vector graphics (sometimes called object oriented graphics) are used by drawing programs. Images are stored as a set of instructions for redrawing the picture.

25 Vector Graphics Take up much less space than bitmaps Are more complicated to calculate and redraw than bitmaps Are used for CAD and graphic design

26 Vector Graphics If you place one object on top of another you can move it later and still see the object below You can stretch and squeeze objects after you have put them on a drawing Objects are always separate from each other You will not see pixels if you zoom in on a vector graphic

27 Vector Graphics and Bitmaps

28

29

30

31 Vector graphics are Device Dependent. This means that the resolution of a printout or screen display depends on the quality of the output device The resolution of a bitmap graphic cannot be improved by upgrading your printer.

32 Examples of Vector Graphics Software Corel Draw Autosketch Google Sketchup DesignWorks Serif Draw Windows Draw Flash

33 Storing sound files Quality of sound file depends on Sample rate, which is the number of times the value of the signal is recorded Bit depth, which is the number of bits to record each sample Sound files are often large and require compression

34 Storing sound files Sample point Analogue signal

35 Calculating the size of a sound file The size of a sound file per second of recorded sound is given by File size(per second) = sampling depth (bits) * sampling frequency (Hz)

36 Calculating the size of a sound file Example A CD quality sound recorded using a sampling frequency of 44KHz and a sampling depth of 16 bits. Solution: File size= 44000 * 16 File size= 704000 bits per second = 704K bits per second

37 Storing video files Video files require storage of both graphical and sound data. Because of this they are large and require compression A series of compression standards have been set by the Motion Pictures Expert Group (MPEG). These are known as MPEG-1, MPEG-2 and so on.

38 Storing video files Each frame in an MPEG video is compressed as a JPEG. Data that stays the same is then removed Only key frames with all the data are then stored Other frames only store changed data MPEG is an example of lossy compression. This means that some of the data is lost when stored (and cannot be recovered)

39 Video file sizes depend on: Frame size: (for example. PAL = 720 x 576 pixels; HDMI = 1920×120 pixels) Frame rate: measured in Frame per second rate (for example: PAL = 25fps HDMI= 60fps ) Bit depth (PAL = 24 bit HDMI = 36 bit) Audio sample rate and bit depth Compression method (Codec)

40 Uncompressed video files As video files are simply a collection of images, all we need to do is calculate the size of one image (i.e. one frame) and multiply that by the number of frames in the entire video. File Size (Bytes) = Frame Size (Bytes) x Frame Rate (frames per second [fps]) x Video Time (seconds) The sound element of the file then needs to be added


Download ppt "Software Design and Development Storing Data Part 2 Text, sound and video Computing Science."

Similar presentations


Ads by Google