0% found this document useful (0 votes)
25 views34 pages

02 2 CH8

Uploaded by

unicornshawneya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views34 pages

02 2 CH8

Uploaded by

unicornshawneya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

Multimedia Data

Representation
(Chapter 8)

CS170
Computer Applications for Business

1
2
Multimedia Data
Representation • Digitizing Sound
• Analog to Digital
(Chapter 8)
• Sampling process
• Digitizing Color • Sampling rate
• RGB lights • Nyquist rule
• Black and White colors • Bit depth
• Intensities • Digitizing Images and Video
• Lighten Up: Changing • Compression terms
Colors
• lossless
• Increasing Intensities • Run-length encoding
• Increasing Brightness • lossy
• Changing Contrast • luminance
• Adding Color to a Black and • chrominance 3
White picture
CS 170 - Trees 4
CS 170 - Trees 5
Color Encoding
https://www.rapidtables.com/web/color/RGB_Color.html

• Pixels are small points of colored light arranged in a grid


• A pixel is a combination of 3 colored lights
• Red, Green and Blue (RGB)
• Black is the absence of light
• White is the full intensity of each color

• We use a byte to denote the intensity of light


• Color of a single pixel requires 3 bytes (1 for each color)
• With 24 bits = 224 = 16,777,216 possible colors 6
Photos

• 479 pixels x 332 pixels


=159,028 pixels

• Each pixel has a red, green, blue component (RGB)


that is represented by 3 numbers: (51, 153, 255)

• Therefore, each pixel is composed of 24 bits (8 bits


x 3 colors): 24 x 159,028 pixels = 3,816,672 bits.
Color Encoding
• Black is the absence of light
Binary: RGB(0000 0000, 0000 0000, 0000 0000)
Decimal: RGB(0, 0, 0)
Hex: RGB(0, 0, 0)
• White is the full intensity of each color
Binary: RGB(1111 1111, 1111 1111, 1111 1111)
Decimal: RGB(255, 255, 255)
Hex: RGB(FF, FF, FF)
• What do we get with Decimal: RGB(0, 255, 0)?
8
Computing on
Representations
• When digital information is changed
through computation, it is known as
computing on representations

• Examples:
• Red Eye Removal
• Photo Corrections
• Color Changes
• Artistic Effects
9
Brightness and Contrast
• The values of the pixels can be
represented in a Levels graph
• Brightness refers to how close to white the
pixels are
• Contrast is the size of difference between
the darkest and lightest portions of the
image

10
Brightness
• We want all the pixels to
be closer to intense
white, but to keep their
relative relationships
• Add 14 to each pixel
A pixel which is
RGB (195, 195, 195)
becomes
RGB (209, 209, 209)
RGB (22, 23, 24)
becomes 11

RGB (36, 37, 38)


Contrast
• Goal is not to shift the
Levels Graph right, but
rather to “stretch it out”
toward the right
• Add an amount to each
pixel as before
• Add a smaller amount
for dark pixels
• Add a larger amount for
light pixels
12
Contrast
• Darkest pixel in the picture = 38
• Lightest pixel in the picture =
239
A pixel which is
RGB (195, 175, 205)
becomes
RGB (208, 186, 218)
A pixel which is
RGB (38, 57, 72)
becomes
RGB (38, 59, 75)
13
Adding Color

• Highlights

• Midrange

Pixel Type R Change G Change B Change


Highlights +6 0 -4
Midrange +8 +5 -4
Shadows +16 0 -8
• Shadows
14
Adding Color

15
Digitizing Sound
• An object creates sound by vibrating in a
medium (such as air)
• Vibrations push the air causing pressure
waves to emanate from the object, which
in turn vibrate our eardrums
• Vibrations are then transmitted by three
tiny bones to the fine hairs of our cochlea,
stimulating nerves that allow us to sense
the waves and “hear” them as sound
16
Sampling

17
Nyquist Rule for Sampling
•If the sampling were too slow, sound waves
could “fit between” the samples and you would
miss important segments of the sound
• The Nyquist rule says that a sampling rate must
be at least twice as fast as the highest frequency
• Because humans can hear sound up to roughly
20,000 Hz, a 40,000 Hz sampling rate fulfills the
Nyquist rule for digital audio recording
• For technical reasons, a somewhat faster-than-
two-times sampling rate was chosen for digital
audio (44,100 Hz)
18
How Many Bits per Sample?
• To make the samples perfectly accurate,
you need an unlimited number of bits for each
sample, which is impossible
• The more bits there that are used, the more
accurate the measurement is
• Bit Depth - the number of bits used to
represent each sample
• Audio digital representation typically uses 16
bits

19
Digitizing Process
• The digitizing process works as follows:
– Sound is picked up by a microphone (transducer)
– Signal is fed into an analog-to-digital converter (ADC),
which takes the continuous wave and samples it at
regular intervals, outputting for each sample a binary
number to be written to memory
– To listen, process is reversed

20
Advantages of Digital Sound
• A key advantage of digital information is
the ability to compute on the
representation
• Remove waves too high or too low for
humans to hear
• Overlay small errors (coughing)
• Change the pitch
• Auto Tune
21
Digital Images and Video
• An image is a long sequence of RGB pixels
• The picture is two dimensional, but think of
the pixels stretched out one row after another
in memory

22
A video???

• A video can have a duration (T) of 1 hour (3600sec), a


frame size of 640x480 at a color depth of 24bits and a
frame rate of 25fps.

• pixels per frame = 640 * 480 = 307,200


• bits per frame = 307,200 * 24 = 7,372,800 = 7.37Mbits
• bit rate (BR) = 7.37 * 25 = 184.25Mbits/sec
• video size (VS) = 184Mbits/sec * 3600sec =
662,400Mbits = 82,800Mbytes = 82.8Gbytes
Compression - Lossless vs. Lossy

ZIP
ALAC-audio
PNG-image

JPEG-image
MPEG-video
MP3-audio
24
Audio Compression
• Removing sounds that are too high
or low to hear

Video/Picture Compression
• Humans are quite sensitive to small
changes in brightness (luminance)
• Brightness levels of a photo must be
preserved between uncompressed and
compressed versions
• People are not sensitive to small
differences in color (chrominance)
25
MPEG Compression

26
Everything is bits!
What does a number mean?
• The same byte with a 65 in it (01000001) might be
interpreted as…
• The character 'A'
• A very small piece of sound (e.g., 1/44100-th of a
second)
• The amount of redness in a single dot in a larger
picture RGB (65, 200, 12)
• The amount of redness in a single dot in a larger
picture which is a single frame in a full-length motion
picture
Bits Are a Bias-Free
Universal Medium

•Bias-free, because they can be


interpreted to mean anything

•Universal, because bits can represent


any set of discrete things

28
Online Multimedia Challenges
• The challenge of Latency
• Latency is the time it takes for information to be created
or delivered
• The challenge of Bandwidth
• Bandwidth is the amount of data that can be
transmitted per unit of time
• Throughput is the actual amount of data that is
transmitted
• Ideally, we want HIGH BANDWIDTH and LOW
LATENCY.

29
CHECK

• What colors make up a pixel? What are they?

• How many colors are possible?

• What color is the absence of light?

• In Decimal it is denoted how?

30
CHECK

• How do we decrease brightness?

• How do we decrease contrast?

• How do we colorize a black and white


photo?

31
CHECK

• To digitize sound we take ____ at specific


_____.
• What is the rule for determining the rate of
samples?

• What is the bit depth?

32
CHECK

• What is the difference between lossy


and lossless?

• What is latency?

• What is the difference between bandwidth


and throughput?

33
Multimedia Data
Representation • Digitizing Sound
• Analog to Digital
(Chapter 8)
• Sampling process
• Digitizing Color • Sampling rate
• RGB lights • Nyquist rule
• Black and White colors • Bit depth
• Intensities • Digitizing Images and Video
• Lighten Up: Changing • Compression terms
Colors
• lossless
• Increasing Intensities • Run-length encoding
• Increasing Brightness • lossy
• Changing Contrast • luminance
• Adding Color to a Black and • chrominance 34
White picture

You might also like