Presentation is loading. Please wait.

Presentation is loading. Please wait.

Digital Media Lecture 3: Image Encoding Bitmapped images Georgia Gwinnett College School of Science and Technology Dr. Jim Rowan.

Similar presentations


Presentation on theme: "Digital Media Lecture 3: Image Encoding Bitmapped images Georgia Gwinnett College School of Science and Technology Dr. Jim Rowan."— Presentation transcript:

1 Digital Media Lecture 3: Image Encoding Bitmapped images Georgia Gwinnett College School of Science and Technology Dr. Jim Rowan

2 The next several lectures will cover… Bitmapped images Vector graphics, 2D Color Vector graphics, 3D

3 But first: A little more about “Telling the story” The media you choose shapes the way the story is told The way you present data affects how it is interpreted –Let’s get started: Critical Thinking: What is it….

4 What would you choose? You need heart bypass surgery You have a number of hospitals to choose from You make your decision based on statistics Do you choose the hospital with the highest or lowest death rate for that procedure?

5 The way you display the data affects how it is understood Understanding occurs at the crossroads of computer graphics, cognitive science and psychology The way data is displayed affects how people interpret it –Colors can enhance or detract from a point –The numeric scales used on a graph –Different types of graphs emphasize different aspects of the numbers

6 For example: Using a graph to tell the story Is this the graph of a stable company?

7 For example: Using a graph to tell the story Is this the graph of a stable company?

8 What about anthropogenic global warming? The pro- side:

9 What about anthropogenic global warming? The anti- side:

10 What about anthropogenic global warming? The pro- side: 19401950 “Look how much of the glacier has melted during this 10 year period”

11 What about anthropogenic global warming? The anti- side: 19502004 “Look how little of the glacier has melted during this 50+ year period”

12 Want more of this?

13 Now… about those images! First: Bitmapped images –File size is dictated by: Width and height Color depth Method of encoding –They don’t scale well Second: Vector graphics File size dictated by the number of objects They do scale well Images as piles of numbers: Intro to Images Images as piles of numbers: Ways to store images as numbers: Bitmapped images

14 Bitmapped images Color depth 1 bit 10 x 5 = 50 pixels x 1 bit = 50 bits 50 bits / 8 = 6.25 = 7 bytes

15 Bitmapped images Color depth 24 bit (3 byte) RGB 10 x 5 = 50 pixels 50 pixels x 3 bytes = 150 bytes Much bigger

16 Bitmapped images Get big fast We can make them smaller? –Table encoding (next) –Run length encoding (later) –Compression (later)

17 Bitmapped images: Table encoding Build a color table: List the colors in a table Number them in binary –# 00 White (255.255.255) –# 01 Blue (0,0,255) –# 10 Red (25,0,0) Build a table of pointers: Color table size: 3 colors, 3 bytes each color 3 x 3 = 9 bytes Pointer table size: 10 x 5 x 2 bits = 100 bits/8 = 12.5 = 13 bytes Total encoding size: 9 bytes + 13 bytes = 21 bytes

18 Bitmapped vs Vector Here are two images, blue squares with smaller colored squares inside them Both are displayed as 1024 X 1024 pixels in size Each with 3 byte (24 bit) color encoding Which would have the larger (in terms of file size) internal model? Why? bitmapped graphic vector graphic

19 Vector graphic One way of doing vector graphics… (For discussion’s sake) Defining each square as a pair of x,y points So: each square’s size is defined by 4 numbers Now color them using 3 bytes each 4 squares x 4 numbers each x 3 bytes each for color: Total file size = 48 bytes

20 Bitmapped graphic 1024 x 1024 x 3 = 3,145,728 bytes

21 Here are two more complex images Both are displayed as 1024 x 1024 pixels in size Each with 3 byte (24 bit) color encoding Which would have the larger (in terms of file size) internal model? Why? bitmapped graphic vector graphic Bitmapped vs Vector

22 Bitmapped graphic Both of these images would have the same file size 1024 x 1024 x 3 = 3,145,728 bytes As complexity increases, file size remains the same But it doesn’t scale well

23 Vector graphic Not complex 48 bytes Complex 3000 squares+ Each is defined by 7 numbers (two pairs of points + color) 3000 x 7 = 21,000 bytes As complexity increases, so does the file size But it scales without problems

24 The point here is: Scaling is a problem for bitmapped graphics Scaling is not a problem for vector graphics Bitmapped graphics don’t change in size as the image gets more complex Vector graphics get bigger the more complex the image

25 Visual comparison: Bitmapped scaling Vector graphic scaling

26 Why doesn’t a bitmapped image scale well? Original image: 10 x 5 Now make it twice as big

27 Why doesn’t a bitmapped image scale well? Original image: 10 x 5 Now make it twice as big in two dimensions

28 Why doesn’t a bitmapped image scale well? Original image: 10 x 5 Now make it twice as big What happens if there are two colors next to one another?

29 Why doesn’t a bitmapped image scale well? Original image: 10 x 5 Now make it twice as big What happens if there are two colors next to one another?

30 Why doesn’t a bitmapped image scale well? Original image: 10 x 5 To make it 50% larger...

31 Why doesn’t a bitmapped image scale well? To make it 50% larger… Is it going to be 3 pixels long? Is it going to be 4 pixels long?

32 Making it smaller… A simple example Making it 50% smaller in two dimensions Involves tossing out 75% of the pixels…

33 Making it smaller… A more complicated example Now… mixed colors: What color do you use? The point here is that scaling Bitmapped images is problematic

34 The point here is: Scaling is a problem for bitmapped graphics

35 Manipulating images Both Bitmapped and Vector graphics images use image layers as organizational tools Bitmapped images can use layers –Like tracing paper –Like stencils –To manipulate color channels

36 Bitmapped image manipulation Bitmapped images do not know what objects they contain so there are a variety of selection tools –Regular shapes like square and circles –Irregular shapes lasso (polygon, magnetic, magic wand…) –“magnetic" snaps to an enclosed object using edge-detection routines

37 Bitmapped image manipulation Selection tools allow the application of filters to only the selected parts of the image –The unaffected area is called a mask... can be thought of as a stencil –The opening in the mask allows background to show through

38 Masks as layers A 1-bit mask –Either a 0 or a 1 –can be either transparent or opaque An 8-bit mask –allows 2 ** 8 = 256 levels of transparency... –AKA alpha channel

39 Masks Can have a gradient to produce a softer transition... a feathered edge Can use anti-aliasing along the edge which more effectively hides the hard edge visually Layers can have masks associated with them Allows interesting compositing of image parts

40


Download ppt "Digital Media Lecture 3: Image Encoding Bitmapped images Georgia Gwinnett College School of Science and Technology Dr. Jim Rowan."

Similar presentations


Ads by Google