1 / 36

Overview

B.A. (Mahayana Studies) 000-209 Introduction to Computer Science November 2005 - March 2006 10. Multimedia Data. We examine the main types of multimedia data (text, graphics, video, sound), and look at data compression. Overview. 1. Text 2. Graphics 3. Video 4. Sound

ifeoma-head
Download Presentation

Overview

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. B.A. (Mahayana Studies)000-209 Introduction to Computer ScienceNovember 2005 - March 200610. Multimedia Data We examine the main types of multimedia data (text, graphics, video, sound), and look at data compression.

  2. Overview • 1. Text • 2. Graphics • 3. Video • 4. Sound • 5. Data Compression 000-209 Intro to CS. 10/Multimedia Data

  3. 1. Text • Most text files store their text using the ASCII coding scheme. • Each character is translated into 7 bits. • The ASCII character set can contain at most 27 characters (128 symbols) • not enough for many languages 000-209 Intro to CS. 10/Multimedia Data

  4. ASCII Code Table 000-209 Intro to CS. 10/Multimedia Data

  5. ANSI: Extended ASCII • The ANSI code uses 8 bits to represent a character. • can code 256 letters or symbols (28) • better for many European and Asian languages 000-209 Intro to CS. 10/Multimedia Data

  6. Unicode • Unicodeis a 16-bit code which can represent 65,536 characters (216). • enough for any language character set • useful in international business documents • Unicode helps with the localization of software • the modification of software for specific countries 000-209 Intro to CS. 10/Multimedia Data

  7. 2. Graphics • Digital photos are stored as bitmap images • the picture is represented by pixels (square dots) • each pixel has a single colour 000-209 Intro to CS. 10/Multimedia Data

  8. Black and White Graphics • The simplest bitmap images only uses black and white: • each pixel is coloured black or white • called monochrome graphics • A pixel can be stored as a '0' (black) or '1' (white) in the graphics file • so each pixel needs 1 bit of memory continued 000-209 Intro to CS. 10/Multimedia Data

  9. 000-209 Intro to CS. 10/Multimedia Data

  10. Grayscale Graphics • A greyscale graphic is a bitmap using shades of gray • e.g. 256 shades of gray • Each pixel can be white, black, or one of 254 shades of gray. • 256 is 28, so each pixel requires 8 bits of information • Greyscale files are bigger than monochrome files. 000-209 Intro to CS. 10/Multimedia Data

  11. Colour Graphics • Colour images can use 16, 256, 65,536, or 16.7 million colours. • More colours needs more bits for each pixel • 16 colours = 24 = 4 bits needed for each pixel • 16.7M colours = 224 = 24 bits needed for each pixel • Graphics files with full colour can get big! 000-209 Intro to CS. 10/Multimedia Data

  12. File Sizes • A 640x480 size bitmap image needs 640x480 pixels? How big is the file? • The size depends on the number of colours that need to be represented: • 307,200 bytes for 256 colours (28) • 614,400 bytes in 65,536 colours (216) • 921,600 bytes in 16.7 million colours (224) 000-209 Intro to CS. 10/Multimedia Data

  13. Reducing the Size • Three techniques: • editing the image (shrinking or cropping) • compressing the full image • dithering - use groups of pixels composed of two or more colors to produce the illusion of extra colours 000-209 Intro to CS. 10/Multimedia Data

  14. Dithering Example Original; 16.7M colours 16 colours; no dithering 16 colours; dithering 000-209 Intro to CS. 10/Multimedia Data

  15. Image File Formats • Common bitmap formats are .bmp, .pcx • For line drawings, with few colours, save the file as a GIF image (file ends with .gif) • For photos, with lots of colours, use the JPG (JPEG) format (file ends with .jpg) 000-209 Intro to CS. 10/Multimedia Data

  16. Painting Software Painter 25 (free) http://www.jansfreeware.com/ Microsoft Paint 000-209 Intro to CS. 10/Multimedia Data

  17. Photo Editing Software The Gimp (free) http://www.gimp.org/ Photoshop 000-209 Intro to CS. 10/Multimedia Data

  18. Vector Graphics • Vector graphics store pictures in terms of lines, curves, and other shapes • line drawings look better than in paint programs • lines, curves, shapes are smooth • photos look worse • line drawings require much less hard disk space • filename extensions include .wmf, .dxf, .mgx, .eps, and .cgm 000-209 Intro to CS. 10/Multimedia Data

  19. Vector vs. Bitmaps Vector Graphic Picture Bitmap Picture 000-209 Intro to CS. 10/Multimedia Data

  20. Vector Graphics Software Inkscape (free) http://www.inkscape.org/ CorelDraw 000-209 Intro to CS. 10/Multimedia Data

  21. 3. Video • A video is composed of a series of pictures (frames), displayed at 30 frames per second (FPS). • A video file requires a lot of hard disk space • a 2 hour movie may use more than 66 gigabytes (GB) on your hard disk • VideoforWindows, QuickTime, and MPEGare popular video formats. 000-209 Intro to CS. 10/Multimedia Data

  22. Video Playing Software Windows Media Player BSPlayer (free) http://www.bsplayer.org/ 000-209 Intro to CS. 10/Multimedia Data

  23. 4. Sound • Waveform audiois a digital representation of sound. • music, voice, and sound effects can be recorded as waveforms • A sound is converted into a waveform by using sampling. 000-209 Intro to CS. 10/Multimedia Data

  24. Sound Wave Sampling Wave is sliced into vertical segments called samples. Analog sound wave is a smooth curve of continuous values. Height of sample is converted to a number. 000-209 Intro to CS. 10/Multimedia Data

  25. Sampling Quality • Sampling rateis the number of times per second that sound is measured during the recording • 1000 samples per second = 1 KHz (kilohertz) • more samples = better quality sound • Height of each sample saved as an: • 8-bit number for radio-quality • 16-bit number for high-fidelity • more bits = better quality sound 000-209 Intro to CS. 10/Multimedia Data

  26. Sound Editing Software WavePad (free) http://www.nch.com.au/wavepad/ 000-209 Intro to CS. 10/Multimedia Data

  27. MIDI • MIDI (Musical Instrument Digital Interface) files contain instructions that MIDI sound cards use to play the sounds. • MIDI is like a music score, played by MIDI 'instruments' in the sound card • MIDI files are much smaller than waveform files • 3 minutes of music can be stored in a ~10 KB file 000-209 Intro to CS. 10/Multimedia Data

  28. MIDI Software Anvil Studio (free) http://www.anvilstudio.com/ record, write MIDI 000-209 Intro to CS. 10/Multimedia Data

  29. 5. Data Compression • Data compressionreduces the amount of hard disk space needed to store data. • Reversing the data compression is called uncompressing, decompressing, extracting, or expanding. • The compression ratio is the percentage reduction in the size of the data when it is compressed. 000-209 Intro to CS. 10/Multimedia Data

  30. File Compression Software WinZip http://www.winzip.com/ ZipItFast (free) http://www.zipitfast.com/ 000-209 Intro to CS. 10/Multimedia Data

  31. Compressing Text • Adaptive pattern substitution • scans text looking for repeating patterns • substitute a byte for the pattern and make a dictionary entry • Example • there the theme is "that was then" becomes • Xre X Xme is "that was Xn" dictionary X the 000-209 Intro to CS. 10/Multimedia Data

  32. Compressing Graphics • Bitmap graphics often contain large blocks of the same colour. • Run-length encoding • runs of data (long blocks with the same data) are replaced by a single data value and a count continued 000-209 Intro to CS. 10/Multimedia Data

  33. Example: • WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWBWWWWWWWWWWWWWW becomes • 12WB12W3B24WB14W • W = white; B = black 000-209 Intro to CS. 10/Multimedia Data

  34. Lossy vs Lossless Compression • Lossy compression“throws away” some data from the graphic • what the human eye won't miss • used in the JPEG file format Original Image (12 KB) Compressed (85% less info, 1.8 KB) 000-209 Intro to CS. 10/Multimedia Data

  35. Losslesscompression • the exact same data can be reconstructed from the compressed data • used in the PNG file format • Lossless compression is also used in software compression tools such as WinZip. 000-209 Intro to CS. 10/Multimedia Data

  36. Compressing Video • The number of frames per second (FPS) affects the perceived smoothness of the video • high quality = 30 FPS • Intra-frame compression- shrink each frame using image compression techniques. • Motioncompensation stores only the data that changes between one frame and the next • can produce compression ratios of 200:1 000-209 Intro to CS. 10/Multimedia Data

More Related