Title: Image Editing II
1Image Editing II
2Simple Blending
.7 x
.5 x
Each pixel in a layer is multiplied by the same
opacity value
3Simple Blending
Opacity values can be visualized as gray levels
0.7
0.5
x
x
4Complex Blending
- Each pixel in a layer can have a different
opacity value - The opacity values for a layers pixels can be
visualized as a grayscale image - This grayscale image is called a mask
5Complex Blending
Layer Masks
x
x
6Selection Mask
- One bit for each pixel
- 1 selected
- 0 not selected
7Selection Mask
Image
SelectMask
Selecting all yellow and some red pixels
8Copy
Image
SelectMask
PasteImage
PasteMask
9Copy Algorithm
- for (every pixel x,y in the image)
- if (selectMaskx,y 1)
- pasteImagex,y imagex,y
- pasteMaskx,y 1
-
- else
- pasteMaskx,y 0
-
10Layer Composition Algorithm
Image
Layer maskimage
for (every pixel x,y in the layer) if
(maskx,y 1) newx,y layerx,y
else newx,y imagex,y
11Moving a Layer
12Moving a Layer
Image
Layer maskimage
Move layer pixels without touching image pixels
13Cut
What happens to the deleted pixels?
14Picture Editing
15Object representations of pictures
- Types of objects
- Lines
- Rectangles
- Ovals
- Text
- Curves
- Pictures
Text
16Picture array of drawing objects
- 0) Rect(10,10,50,40,tan,yellow)
- 1) Oval(0,30,40,20,blue,purple)
- 2) Line(20,0,20,80,gray)
17Adding an object
- 0) Rect(10,10,50,40,tan,yellow)
- 1) Oval(0,30,40,20,blue,purple)
- 2) Line(20,0,20,80,gray)
- 3) Text(25,25,Hello,
- black,Times )
Hello
18Selecting an object
- 0) Rect(10,10,50,40,tan,yellow)
- 1) Oval(0,30,40,20,blue,purple)
- 2) Line(20,0,20,80,gray)
- 3) Text(25,25,Hello,
- black,Times )
Hello
CurObj 2
19Deleting an object
- 0) Rect(10,10,50,40,tan,yellow)
- 1) Oval(0,30,40,20,blue,purple)
- 2) Line(20,0,20,80,gray)
- 3) Text(25,25,Hello,
- black,Times )
Hello
CurObj 2
20Deleting an object
- 0) Rect(10,10,50,40,tan,yellow)
- 1) Oval(0,30,40,20,blue,purple)
- 2) Text(25,25,Hello,
- black,Times )
Hello
CurObj
21Deleting an object
- 0) Rect(10,10,50,40,tan,yellow)
- 1) Oval(0,30,40,20,blue,purple)
- 2) Text(25,25,Hello,
- black,Times )
Hello
Does object delete work like images or like text?
CurObj
22Moving an object
- 0) Rect(10,10,50,40,tan,yellow)
- 1) Oval(0,30,40,20,blue,purple)
- 2) Text(25,25,Hello,
- black,Times )
Hello
23Moving an object
- 0) Rect(10,10,50,40,tan,yellow)
- 1) Oval(30,30,40,20,blue,purple)
- 2) Text(25,25,Hello,
- black,Times )
Hello
24Changing an object
- 0) Rect(10,10,50,40,tan,yellow)
- 1) Oval(30,30,40,20,blue,purple)
- 2) Text(25,25,Hello,
- red,Arial )
Hello
25Move an object back
26Move an object back
- 0) Oval(30,30,40,20,blue,purple)
- 1) Rect(10,10,50,40,tan,yellow)
- 2) Text(25,25,Hello,
- red,Arial )
Hello
27Changing an imageSequoa -gt Sequoia
28Changing an imageSequoa -gt Sequoia
Leaves ugly blank pixels
29Change using objects
Text object
Image object
Sequoa
30Change using objects
Text object
Image object
Sequoia
31Compare
- Why are images better than objects?
- More realistic pictures
- Easy to generate with cameras and scanners
- Why are objects better than images?
- Less space
- Easier to make changes