Lecture 4 Data Formats
Lecture 4 Data Formats
Data Formats
1
DATA FORMATS
Computers
Process and store all forms of data in binary format
Human communication
Includes language, images and sounds
2
DATA FORMATS
Specifications for converting data into computer usable form
3
DATA FORMATS
Proprietary formats
Individual programs can store and process data in any format that
they want
4
COMMON DATA REPRESENTATIONS
5
ALPHANUMERIC DATA
Much of the data that will be used in a computer are originally
provided in human-readable form,
Letters of the alphabet, numbers, and punctuation,
English or some other language
6
ALPHANUMERIC DATA
Three alphanumeric codes are in common use,
ASCII (American Standard Code for Information Interchange)
EBCDIC (Extended Binary Coded Decimal Interchange Code)
Unicode
7
ASCII
Each character represented with a 7 bit code
128 characters
Consists of,
digits 0 to 9,
lowercase letters a to z,
uppercase letters A to Z,
punctuation symbols,
33 non-printing control codes
8
ASCII
9
UNICODE
ASCII and EBCDIC have limitations
8-bit word limit the number of possible characters
Other major languages?
Omitted characters [, ], ^, {, }, ~
10
UNICODE
11
UNICODE
12
2 CLASSES OF CODE
Printing characters
Produced on the screen or printer
Control characters
13
KEYBOARD INPUT
Scan code
When a key is struck on the keyboard, the circuitry in the
keyboard generates a binary code
14
KEYBOARD INPUT
Other alphanumeric inputs:
OCR
Barcode
Magnetic Strip Reader
RFID
15
IMAGE DATA
Images come in many different shapes, sizes, textures, colors,
and shadings
Different requirements require different forms for image
data
Quality of the image
Storage space required
Time to transmit
Ease of modification
16
IMAGE DATA
Two distinct categories
Bitmap or raster images
Characterized by continuous variations in shading, color, shape, and
texture
JPEG, GIF
Graphical objects
Made up of graphical shapes such as lines and curves that can be
defined geometrically
17
IMAGE DATA
Two distinct categories
Bitmap or raster images
Characterized by continuous variations in shading, color, shape, and
texture
JPEG, GIF
Graphical objects
Made up of graphical shapes such as lines and curves that can be
defined geometrically
18
IMAGE DATA
19
BITMAP IMAGES
Bitmap image format
A rectangular image is divided into rows and columns
The junction of each row and column is a point known as a pixel
Pixel is a set of one or more binary numerical values that define the
visual characteristics
20
BITMAP IMAGES
Example each point below represented by a 4 bit code corresponding
to 1 of 16 shades
Meta data
Pixel data
Stored from top to bottom one row at a time
21
BITMAP IMAGES
Data value representing a pixel
Could be as simple as one bit
For color image, might consist of many bytes
RGB
Additional bytes for other characteristics such as transparency and
color correction.
22
BITMAP IMAGES
File size affected by
Resolution
Reducing the size of a pixel to improve details
Levels: number of bits to represent each pixel
Image formats
GIF (Graphics Interchange Format)
JPEG (Joint Photographers Expert Group)
PNG (Portable Network Graphic)
23
OBJECT IMAGES
Object images are made up of simple elements like straight or
curved lines, circles and arcs etc.
Each element can defined mathematically by parameters
Circle requires 3 parameters, Cartesian coordinates + radius
Straight line needs the coordinates of its end points
24
OBJECT IMAGES
Advantages
Require less storage space
Can be manipulated easily
25
VIDEO DATA
Requires a large amount of data
1024 × 768 pixel true-color images at a frame rate of 30 frames per
second?
70.8 megabytes of data per second!
4.25 gigabytes per minute
26
AUDIO DATA
Sound is naturally an analog wave that needs to be digitized
Sampling
1000 samples per second = 1 KHz (kilohertz)
Example : Audio CD sampling rate = 44.1KHz
27
AUDIO DATA
Sampling Rate
28
DATA COMPRESSION
Compression: reducing data so that it requires fewer bytes of
storage space
Compression ratio: the amount of file shrunk
Lossless Compression
Inverse algorithm restores data to exact original form
Examples GIF, PCX, TIFF
05573200001473291000006682732732
0155732041473291056682732732
0155Z0314Z91056682ZZ
29
DATA COMPRESSION
Lossy Compression
Trades off data degradation for file size and download speed
Much higher compression ratios, often 10 to 1
JPEG
MPEG-2?
30
THANK YOU
31