Presentation is loading. Please wait.

Presentation is loading. Please wait.

Fluency with Information Technology

Similar presentations


Presentation on theme: "Fluency with Information Technology"— Presentation transcript:

1 Fluency with Information Technology
7th Edition Chapter 8 Representing Multimedia Digitally

2 Learning Objectives 1.1 Explain how RGB color is represented in bytes
1.2 Change an RGB color by binary addition 1.3 Discuss concepts related to digitizing sound waves 1.4 Explain data compression and its lossless and lossy variants 1.5 Explain the difference between bits and binary numbers 1.6 Explain the meaning of the Bias-Free Universal Medium Principle

3 Digitizing Data Digitizing is more than letters, numbers, and metadata
Digitizing includes other forms of digitized information, known as multimedia: photos, audio, and video The same principles used with letters and numbers to encode information into bits are used with multimedia

4 Color and Light On a computer display:
Pixels are small points of colored light arranged in a grid Each pixel is formed from three colored lights: red, green, and blue This color scheme is known as RGB

5 Colored Light vs Colored Paint
There is a difference between colored light and colored paint Paint reflects some colors and absorbs others When white light strikes paint, some light is absorbed (we can’t see it) and some light is reflected (we see it) In the case of a pixel, the light shines directly at our eyes Nothing is absorbed, nothing is reflected Just see pure colored light

6 Figure 8.1 RGB Combining full intensity RGB light ti create different colors.

7 Yellow = Red + Green? With colored lights, red and green combine to make yellow The exact color we see is determined by the intensity of the colors of light that make it up, instead of which colors are reflected back into our eyes (as opposed to absorbed) by colored surfaces

8 Showing Colors Turning on one pixel's light at a time, the display turns red, green, or blue Turning off all of them makes black Turning on all of them makes white All other colors are made by using different amounts or intensities of the three lights

9 Figure 8.2 Looking Closely at Pixels
At the left is a standard arrow pointer; the other two images are close-ups of its LCD pixel grid. The enlargement in the middle shows the RGB-tripe lights that make pixels. Most are at full intensity, creating the white background, and some are turned off (zero intensity) to create the arrow outline. A 2x2 white pixel region is further enlarged on the right

10 1.1 Encoding RGB Colors The intensity of RGB light is usually given by a binary number stored in a byte Representing the color of a single pixel requires 3 bytes (1 for each color) The smallest intensity is The largest intensity is This makes the range of values between 0 and 255 for each color

11 Encoding Black and White
Black is the absence of light, so the RGB bit assignment for black is all zero-intensity values: for red for green for blue White is the full intensity of each color, so the RGB bit assignment for white is all full-intensity values: for red for green for blue

12 Color and Intensity: Blue
Blue is zero-intensity red, zero-intensity green, and full-intensity blue:: The 8 bits specifying its intensity have position values If we want the sub pixel to be at half intensity, each bit contributes half as much power as the bit to its left

13 Figure 8.3 Vacuum Tubes and Transistors
Progressively increasing the intensity for a blue subpixel; each bit contributes half as much power as the bit to its left

14 Going Gray Begin with a gray color: Red byte: 1100 1110
Green byte: Blue byte: If we convert those binary numbers to decimal, we get RGB (206,206,206) When the red, green, and blue values are the same, the color is a shade of gray

15 Lighten Up To make a color lighter, we increase its intensity
The higher the RGB value, the more intense the color The more intense the color, the lighter the color We can lighten any color through performing binary addition to increase the intensity, as long as the number is not greater than 255 ( in binary)

16 Binary Addition It's the same as decimal addition, but with only two digits Work from right to left, adding digits in each place position, writing the sum below Like decimal addition, there are two cases: Add the two numbers in a place and the result is expressed as a single digit Add two numbers in a place and the result requires carrying to the next higher place

17 1.2 Changing RGB Colors Using Binary Addition
We want to get closer to white, RGB (255,255,255). We decide to go from RGB (206,206,206) to something 16 units lighter (binary ) We can add to each of the existing RGB values for our gray:

18 Figure 8.4 Adding 16 Units of Intensity to a Color
Adding 16 to a binary value to lighten RGB intensities.

19 Computing on Representations
When digital information is changed through computation, it is known as computing on representations One example: Changing the brightness and contrast of a photo

20 Brightness and Contrast
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 Photo manipulation software often gives the values of the pixels in a levels graph

21 The GGGM (Great-Great-Great-Grandmother) Photo
The original photo, before any adjustments.

22 Figure 8.6 Levels Graph The levels graph for the GGGM photo; the horizontal axis is the 256 pixel values, and the vertical axis is the number of pixels in the image with that value

23 Interpreting a Levels Graph
0 percent is called the black point, or in hexadecimal 100 percent is the white point, or FFFFFF in hexadecimal The midpoint is called the gamma point and it is the midpoint in the pixel range

24 Increasing Brightness
We want all the pixels to be closer to intense white, but to keep their relative relationship The goal is to shift the levels graph to the right We can add 16 to each pixel A pixel which is RGB (197, 197, 197) becomes RGB (213, 213, 213)

25 Figure 8.8 Levels Graph: Shifted
Levels graph for the GGGM photo: (a) original, and (b) after brightening by adding 16. Notice that the graph is shifted right by 16.

26 Increasing Contrast The 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, but: Add a smaller amount for dark pixels Add a larger amount for light pixels

27 Calculating What to Add for Increasing Contrast: Step 1
For every original pixel Po, subtract the amount of the lower end of the range: Po – 38 That tells how much to increase each pixel position; smaller (darker) numbers get lightened less than larger (lighter) numbers Then multiply by the size of the new interval divided by the size of the old interval: (𝟐𝟓𝟓−𝟑𝟖)÷ (𝟐𝟑𝟗−𝟑𝟖) = -1.08 Add the low end of the original range back in again to return each pixel to its new position along the second line

28 Calculating What to Add for Increasing Contrast: Step 2
The equation for the value in each pixel position of the new image: Pn = (Po – 38)* Round the answer to a whole number Try it yourself! For original pixel value 239, did you get 255? For original pixel value 157, did you get 167?

29 Figure 8.9 Levels Graph: Stretched
"Stretching" the pixel values right from the range to

30 1.3 Digitizing Sound The force, or intensity of the push, determines the volume of the sound The frequency (the number of waves per second) of the pushes is the pitch

31 Figure 8.12 Sound Wave Sound wave. The horizontal axis is time; the vertical axis is sound pressure.

32 Converting Analog Sound to Digital Sound
To digitize, you must convert to bits For a sound wave, we can use a binary number to record the amount that the wave is above or below the 0 line at a given point on our graph But how often do you measure? There are infinitely many points along the line, too many to record every position of the wave

33 Digitizing Process: Recording
Sound is picked up by a microphone That 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 Then compressed

34 Digitizing Process: Playing Back
The binary numbers are read from memory, decompressed, and sent to a digital-to-analog converter (DAC) An electrical wave is created by interpolation between the digital values (filling in or smoothly moving from one value to another) The electrical signal is then input to a speaker which converts it into back into a sound wave

35 Sampling for Recording
Sample or take measurements at regular intervals The number of samples in a second is called the sampling rate The faster the rate the more accurately the wave is recorded

36 Nyquist Rule for Sampling
The Nyquist rule says that a sampling rate must be at least twice as fast as the highest frequency If the sampling were too slow, sound waves could “fit between” the samples and you would miss important segments of the sound 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)

37 Audio Digitization: Bits Per Sample
Bits must represent both positive and negative values, because the sound wave has both positive and negative sound pressure The more bits there that are used, the more accurate the measurement is Audio digital representation typically uses 16 bits

38 Advantages of Digital Sound
One key advantage of digital information is the ability to compute on the representation One useful computation is to compress the digital audio or reduce the number of bits needed

39 MP3 Compression MP3 compression is a form of computing on the representation It allows for compression (with a ratio of more than 10:1) It can improve compression by simply removing sounds that are too high or low to hear

40 Digital Images An image is a long sequence of RGB pixels
The picture is two dimensional, but you can think of the pixels stretched out one row after another in memory

41 The Size of Digital Imaes
Starting with one 8 × 10 image scanned at 300 pixels per inch That’s 80 square inches, each requiring 300 × 300 = 90,000 pixels (or 7.2 megapixels) At 3 bytes per pixel, it takes 21.6 MB (3 * 7.2) of memory to store one 8 × 10 color image Sending a picture across an old 56 Kb/s phone connection would have taken at least 21,600,000 × 8/56,000 = 3,085 seconds (or more than 51 minutes)

42 Image Compression and Display
A typical monitor used to have fewer than 100 pixels per inch (ppi) A 100 ppi picture would have still required more than five and a half minutes to send And what if we wanted to print the picture, requiring the resolution again? Image compression was required to minimize storage required and time to send

43 Image Compression: Run-Length Encoding
Compression means changing the representation in order to use fewer bits to store or transmit information We can use run-length encoding to specify how long the first sequence (run) of 0’s is, then how long the next sequence of 1’s is, then how long the next sequence of 0’s is, and so on

44 1.4 Lossy vs Lossless Compression
Run-length encoding is a lossless compression scheme The original representation of 0’s and 1’s can be perfectly reconstructed from the compressed version The alternative is lossy compression The original representation cannot be exactly reconstructed from the compressed form Changes are not perceptible

45 Compression Schemes MP3 is probably the most famous compression scheme
MP3 is lossy because the high notes cannot be recovered JPG (or JPEG) is a lossy compression for images Exploits the same kinds of “human perception” characteristics that MP3 does, only for light and color

46 JPEG Compression JPEG is capable of a 10:1 compression without detectable loss of clarity by keeping the changed regions small Humans are quite sensitive to small changes in brightness (luminance), so brightness levels of a photo must be preserved between uncompressed and compressed versions However, we are not sensitive to small differences in color (chrominance)

47 Another Compression Scheme: MPEG
MPEG is the same idea applied to moving images Each image/frame is not seen for long, though it takes many “stills” to make a movie JPEG-type compression is applied to each frame Two consecutive video images are usually very similar; MPEG compression only has to record and transmit the differences between frames This allows for significant compression

48 Digital Representations: Optical Character Recognition (OCR)
A scanner can make a computer document from a printed one by taking its picture This document will not be searchable, since the computer doesn’t know what words it contains Converting the pixels to searchable text is call optical character recognition (OCR)

49 Manipulating Digital Representations: Bits
All discrete information can be represented by bits Discrete things—things that can be separated from each other—can be represented by bits Given a bit sequence: There is no way to know what information it represents The meaning of the bits comes entirely from the interpretation placed on them by users or by the computer

50 1.5 Bits Aren't Necessarily Binary Numbers
Computers represent information as bits Bits can be interpreted as binary numbers Bits can represent: ASCII characters RGB colors An unlimited list of other things

51 Interpreting Bits This set of bits:
Could have these interpretations (among many): 15,796,256 interpreted as a binary number interpreted as an IP address 00 F interpreted as a hexadecimal number

52 1.6 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

53 Summary Analog phenomena can be digitally represented by binary numbers (encoded as bits and bytes) We can compute on representations, changing colors in images, or compressing sounds (among other manipulations) Digital representation through bits gives us the Bias-Free Universal Medium Principle


Download ppt "Fluency with Information Technology"

Similar presentations


Ads by Google