Title: Week 3 Sp05
1IT-101
Introduction to Information Technology
2Overview
- Calculating Bits vs. Bytes
- Ch 5 From the Real World to Images Video
- Introduction to Visual Representation and Display
- Digitizing Gray Scale Images
- Digitizing Color Images
- Digital Video
- Chapter 8 Image Compression
- Chapter 9 Digital Video
3Bits vs. Bytes
1 Byte 8 Bits
Transmission Rates Measured in Bits Per Second
- Bits are often used in terms of a data rate, or
speed of information flow - 56 Kilobit per second modem (56 Kbps)
- A T-1 is 1.544 Megabits per second (1.544 Mbps or
1544 Kbps) - Bytes are often used in terms of storage or
capacity--computer memories are organized in
terms of 8 bits - 256 Megabyte (MB) RAM
- 40 Gigabyte (GB) Hard disk
Computer Storage and Memory Measured in Bytes
4Note! The Multipliers for Storage and
Transmission are Slightly Different.
Kilo or Mega have slightly different values
when used with bits per second or with bytes.
- When Referring to Bytes (as in computer memory
i.e. storage) - Kilobyte (KB) 210 1,024 bytes
- Megabyte (MB) 220 1,048,576 bytes
- Gigabyte (GB) 230 1,073,741,824 bytes
- When Referring to Bits Per Second (as in
transmission rates) - Kilobit per second (Kbps) 1000 bps (thousand)
- Megabit per second (Mbps) 1,000,000 bps
(million) - Gigabit per second (Gbps) 1,000,000,000 bps
(billion)
5More Multipliers for Measuring Bytes
- Kilobyte (K) 210 1,024 bytes
- Megabyte (M) 220 1,048,576 bytes
- Gigabyte (G) 230 1,073,741,824 bytes
- Terabytes (T) 240 1,099,511,627,776 bytes
- Petabytes (P) 250 1,125,899,906,842,624 bytes
- Exabytes (E) 260 1,152,921,504,606,846,976
bytes - Zettabytes (Z) 270 1,180,591,620,717,411,303,424
bytes - Yottabytes (Y) 280 1,208,925,819,614,629,174,706
,176 bytes
6Bits vs. Bytes Some Examples
- Calculate how many bits per second are
transmitted over a bluetooth connection with a
data transfer rate of 721Kbps - 1Kbps 1000 bits per second
- So, 721Kbps 721 x 1000 721,000 bits per
second - Calculate the number of bits that can be stored
on an Apple iPod with a 40GB hard drive - 1 GB 230 bytes 1,073,741,824 bytes
- 40 GB 40 x 1,073,741,824 bytes 42,949,672,960
bytes - 1 byte 8 bits . So,
- 42,949,672,960 Bytes 8 x 42,949,672,960
343,597,383,680 bits
7More Exercises
- Transmission
- Calculate how many bits per second are
transmitted with a 56Kbps modem - Calculate how many bits per second are
transmitted over a fiber optic cable that can
carry 1.25Gbps of data - Storage
- Calculate the number of bits that can be stored
on a 700MB CD - Calculate the number of bits in a 4.6KB word
document stored on your hard disk - Calculate the number of Bytes in a 2MB image you
received through email
8Introduction to Visual Representation and Display
- In the previous chapters, you learned how to
represent information that was in the form of
numbers and text - In this chapter, you will learn how to represent
still and time varying images with binary digits - Images play a fundamental role in the
representation, storage and transmission of
information.
9Image Issues
- The world we live in is analog, or continuously
varying. - We lose information while digitizing, so we make
approximations and determine the tradeoffs
involved. - While digitizing, we need to consider the
following facts - We are producing information for human use
- Take advantage of the fact that human vision has
limitations - Produce displays that are good enough for the
particular application
10Digital Information for Humans
- Many digital systems take advantage of human
limitations (visual, aural, etc) - Most people can detect at most 50 different
shades of gray - The human eye can resolve about 60 lines per
degree of visual arc- a measure of the ability
of the eye to resolve fine detail - When we look at a 8.5 x 11 sheet of paper at 1
foot (landscape) the viewing angles are 49.25
degrees for the horizontal dimension, and 39
degrees for the vertical dimension - We can therefore distinguish
- 49.25 degrees x 60 2955 horizontal lines
- 39 degrees x 60 2340 vertical lines
- These numbers give us a clue about the length of
the code needed to encode images
11- To form a black line, you need two rows of pixels
(one black and one white) to give a visual clue
of the transition from black to white - For our paper example
- Number of pixels needed to represent total image
on a page (2 x 2955) x (2 x 2340) 27,658,800
pixels per page - This number of pixels would be sufficient to
represent any image on the page with no visible
degradation compared to a perfect analog
(unpixelized) image at a distance of one foot
12- lines per degree of visual arc
- Image brought closer to the eye, we can resolve
more detail
Visual Arc
13Pixels
- A pixel is the smallest unit of representation
for visual information - Each pixel in a digitized image represents one
intensity (brightness) level (gray scale or
color)
13 x 13 grid 169 pixels
Gray scale
Color
14How many pixels should be used?
- The number of pixels used in an image depends on
the desired spatial resolution. - High spatial resolution means that the image
contains a large number of pixels. - As the number of pixels that form an image
(spatial resolution) increases when the size of
the image is held constant, the amount of data
that needs to be transmitted, stored or processed
increases as well. However, the image is high in
quality as a result. - So, an artist would most probably want a high
resolution image, and an Internet user would
settle for low resolution to minimize download
time.
15How many pixels should be used?
While keeping the image at a fixed size, if too
few pixels used, image appears coarse
16 x16 (256 pixels)
64 x 64 (4096 pixels)
16A note about device resolution
- When dealing with printers, we often quote the
resolution (spatial) in terms of dots per inch
(dpi), which corresponds to pixels per inch in
our example
17Printer Resolution
- DPI
- It is popular to set laser or ink-jet printer
settings to 600 dpi of resolution - However, if we hold the paper closer, we would
need a greater resolution printer for example
720 dpi, 1200 dpi or greater
18Camera Resolution
- Megapixel
- When buying a digital camera, we are primarily
concerned with its spatial resolution - Digital cameras nowadays come with a range of
spatial resolutions, from less than 1 megapixels
to more than 10 megapixels
19Digitizing Gray Scale Images
- The first step to digitize a black and white
(gray scale) image composed of an array of gray
shades, is to divide the image into pixels, the
number depending on the required spatial
resolution. - The next step is to determine the number of
brightness levels (shades of gray, from black to
white) that we wish to represent, depending on
the desired brightness resolution. - If, for example we want 64 brightness levels,
then we need to assign a 6 bit code for each
pixel. - Each pixel is examined, and its brightness level
is rounded off to the closest brightness level
out of the 64 levels that we have available - As a result of this operation, each pixel now has
a 6-bit number associated with it, representing
the brightness level that is closest to the
actual brightness level at that pixel.
20- This process is known as quantization - (we will
learn more about this later in the course) - it
is the process of rounding off actual continuous
values so that you end up with discrete
information that can be represented by a finite
number of bits. - As a result of the operations just described, the
analog image is digitized and represented by a
string of binary digits
1010010101010101010
216-bit image (64 gray levels)
The effect of reducing the brightness resolution.
- In the figures below, each pixel in the image is
represented by - 6 bits, 3 bits and 1 bit. The spatial resolution
is the same for - all 3 pictures.
3-bit image (8 gray levels)
221-bit image (black and white)
23How much storage is needed?
- Total number of bits required for storage total
number of pixels number of bits used per pixel - For example Black and white photo
- 64 x 64 pixels
- Use 32 gray levels (5 bits)
- 64 x 64 x 5 20,480 bits
- 20, 480 / 8 2,560 / 1024 bytes 2.5KB
- Remember data storage is in bytes
- KB represents 210 or 1024 bytes
24Another example
- Black and White photo
- 256 x 256 pixel
- 6 bits (64 gray levels)
- How much storage is needed?
- 256 x 256 x 6 393,216 bits
- 393,216 / 8 49,152 bytes
- 49,152 / 1024 48 KB
25Image Resolution - Summary
- Since the total number of bits required for
storage total number of pixels number of bits
used per pixel, there are two ways to reduce the
number of bits needed to represent an image - Reduce total number of pixels
- Reduce number of bits used per pixel
- Applying these however, reduces the quality of
the image. The first results in low spatial
resolution (image appears coarse). The second
results in poor brightness resolution, as seen by
the previous couple of slides. -
- The amount of storage can, however be reduced by
applying Image Compression techniques (discussed
later).
26Next Topic
Introduction to Information Technology
27Overview
- Chapter 5 From the real world to Images and
Video - Digitizing Color Images
- Digital Video
- Chapter 8 Image Compression
- Lossless compression
- Lossy compression
- Chapter 9 Digital Video
- MPEG video compression
28Digitizing Color Images
- Recall that any color can be created by adding
the right proportions of red, green and blue
light. - If we wish to digitize a color image, we must
first divide the image into pixels, again
depending on the required spatial resolution. - We must then examine each pixel, and determine
the amount of red, green and blue (RGB) that is
used to form the color at each pixel location. - We must then round off these values to achieve
the closest color on our color palette from among
the different colors whose number depends on the
desired brightness resolution.
29- Finally, we must convert these three levels to a
binary number of a predefined length. - For example
- If we use 3 bits for each color value, we would
be able to represent 8 intensity levels each of
red, green and blue - This representation would require 9 bits per
pixel - This would give us 512 different colors per pixel
30Example how much storage
- Color photo
- 256 x 256 pixel
- 9 bits per pixel (3 bits each for red, green and
blue) - 256 x 256 x 9 589,826 bits
- 589,826/8 73,728 bytes
- 73,728/1024 72 KB of storage needed
to store this color photo
31Hue Luminance Saturation
- Another approach to color representation of
images is Hue, Luminance and Saturation (HLS) - This system does not represent colors by
combinations of other colors, but it still uses 3
numerical values - Hue where the pure color component falls on a
scale that extends across the visible light
spectrum - Luminance how light or dark a pixel is
- Saturation how pure the color is, i.e. how
much it is diluted by the addition of white (100
saturation means no dilution with white)
32Video
- Human perception of movement is slow
- Studies show that humans can only take in 20
different images (frames) per second before they
begin to blur together - If these images are sufficiently similar, then
the blurring which takes place appears to the eye
to resemble motion, in the same way we discern it
when an object moves smoothly in the real world. - We can detect higher rates of flicker, but only
to about 50 per second - This phenomenon has been used since the beginning
of the 20th century to produce moving pictures,
or movies. - Movies show 24 frames (images) per second, but
flash at 48 per second
33- TV works similarly, but instead of a frame, TV
refreshes in lines across the tube - This same phenomenon can be used to create
digitized video--a video signal stored in binary
form - We have already discussed how individual images
are digitized digital video simply consists of a
sequence of digitized still images, displayed at
a rate sufficiently high to appear as continuous
motion to the human visual system. The individual
images are obtained by a digital camera that
acquires a new image at a fast enough rate (say,
60 times per second), to create a time-sampled
version of the scene in motion - Because of human visual latency, these samples at
certain instants in time are sufficient to
capture all of the information that we are
capable of taking in!
34Adding up the bits
- Assume a screen that is 512 x 512 pixels --
about the same resolution as a good TV set. - Assume 3 bits per color per pixel, for a total of
9 bits per pixel - Let's say we want the scene to change 60 times
per second, so that we don't see any flicker or
choppiness. This means we will need 512 x 512
pixels x 9 bits per pixel x 60 frames per second
x 3600 seconds 500 billion bits per hour --
just for the video. Francis Ford Coppola's The
Godfather, at over 3 hours, would require nearly
178 GB of memory using this approach. - But, do films actually require this much storage?
No.. - The reason we can represent video with
significantly fewer bits than in this example is
due to compression techniques, which take
advantage of certain predictabilities and
redundancies in video information to reduce the
amount of information to be stored.
35Image Compression
- Near Photographic Quality Image
- 1,280 x 800 pixels, with 24 bits of color
information per pixel - Total 1280 x 800 x 24 24,576,000 bits
- 56 Kbps modem
- 56,000 bits/sec
- How long does it take to download? 24,576,000 /
56,000 439 seconds/60 7.31 minutes
Obviously image compression is essential.
36Image Compression
- Images are well suited for compression
- Images have more redundancy than other types of
data. - Images contain a large amount of structure.
- Human eye is very tolerant of approximation
error. - 2 types of image compression
- Lossless image compression
- Lossy image compression
- There is a tradeoff between image quality and
degree of compression - In lossless image compression, all the original
data is restored upon decompression, but the
amount of compression which can be achieved is
not very high. - In lossy image compression, some of the original
data is lost, but a high degree of image
compression can be achieved. - Generally, the higher the degree of compression,
the higher the data loss. - A high degree of image compression is essential
to reduce both download time and storage space
37Lossless Image Compression
- Every detail of original data is restored upon
decompression - Examples Run Length Encoding, JPEG, GIF
- Run Length Encoding
- Used in an image format called PCX, commonly used
in PCs - Provides a small amount of compression
- Idea behind it is that if a long string of pixels
are identical, then compression can be achieved
by only sending a special code that represents
that string of pixels - e.g Instead of sending 111111111111111111111111,
we can send the same information as 24 1s - GIF
- Short for Graphics Interchange Format
- A commonly encountered compressed image format
- Provides a moderate amount of compression
- Developed by CompuServe, one of the first
companies to provide telephone based computer
network access - Uses the Lempel-Ziv-Welch algorithm to compress
data
38Lossless Image Compression
- JPEG - Joint Photographic Experts Group
- One of the most commonly used image compression
technique/standard - Can provide high compression
- 29 distinct coding systems for compression, of
which 2 are for Lossless compression - Lossless JPEG uses a technique called predictive
coding to attempt to identify pixels later in the
image in terms of previous pixels in that same
image
JPEG and GIF are the standard image formats on
the Web.
39Lossy Image Compression
- Portion of original data is lost
- Degree of data loss depends on the degree of
compression - Good for images and audio
- Example JPEG
- Lossy JPEG relies on image simplification by
removing image complexity at some loss of
fidelity
40Digital Video Compression (MPEG)
Motion Picture Expert Group (MPEG) standard for
video compression.
- MPEG is a series of techniques for compressing
streaming digital information - DVDs use MPEG coding
- MPEG achieves compression results on the order of
1/35 of original - If we examine two still images from a video
sequence of images, we will almost always find
that they are similar - This fact can be exploited by transmitting only
the changes from one image to the next. This is
called Image Difference Coding - Many pixels will not change from one image to the
next.
41Example
- Recall Godfather example - it required 178 GB of
storage. - With MPEG, this can be reduced to only a few GB,
and stored in at most 2 DVDs.
42Comments for next class
- Go over todays lecture notes
- Go over todays examples
- Read chapters 7, 6 (94-98), 3 error coding, and 4
- HW2 due next class
- Bring questions for discussion during review
session