image editing ii

Post on 21-Jan-2016

49 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

Image Editing II. Simple Blending. = .7 x. + .5 x. Each pixel in a layer is multiplied by the same opacity value. Simple Blending. Opacity values can be visualized as gray levels. 0.7. 0.5. x. x. =. +. Complex Blending. Each pixel in a layer can have a different opacity value - PowerPoint PPT Presentation

TRANSCRIPT

Image Editing II

Simple Blending

= .7 x + .5 x

Each pixel in a layer is multiplied by the same opacity value

Simple Blending

= +

x x

Opacity values can be visualized as gray levels0.7 0.5

• Each pixel in a layer can have a different opacity value

• The opacity values for a layer’s pixels can be visualized as a grayscale image

• This grayscale image is called a “mask”

Complex Blending

Complex Blending

= +

x x

Layer Masks

Selection Mask

• One bit for each pixel1 = selected

0 = not selected

Selection Mask 

Image SelectMask0 0 0 0 0 0 0 0 0 00 0 0 0 0 1 1 1 0 00 0 1 1 1 1 1 1 0 00 0 1 1 1 1 1 1 0 00 0 1 0 0 1 1 1 0 00 0 1 0 0 1 1 1 0 00 0 1 1 1 0 0 0 0 00 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0

Selecting all yellow and some red pixels

Copy Image SelectMask

0 0 0 0 0 0 0 0 0 00 0 0 0 0 1 1 1 0 00 0 1 1 1 1 1 1 0 00 0 1 1 1 1 1 1 0 00 0 1 0 0 1 1 1 0 00 0 1 0 0 1 1 1 0 00 0 1 1 1 0 0 0 0 00 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 00 0 0 0 0 1 1 1 0 00 0 1 1 1 1 1 1 0 00 0 1 1 1 1 1 1 0 00 0 1 0 0 1 1 1 0 00 0 1 0 0 1 1 1 0 00 0 1 1 1 0 0 0 0 00 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0

PasteImage PasteMask

Copy Algorithm

for (every pixel [x,y] in the image) { if (selectMask[x,y] == 1) {

pasteImage[x,y] = image[x,y];pasteMask[x,y] = 1;

}else {

pasteMask[x,y] = 0;}

}

Layer Composition Algorithm0 0 0 0 0 0 0 0 0 00 0 0 0 0 1 1 1 0 00 0 1 1 1 1 1 1 0 00 0 1 1 1 1 1 1 0 00 0 1 0 0 1 1 1 0 00 0 1 0 0 1 1 1 0 00 0 1 1 1 0 0 0 0 00 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0

Layer = mask+image 

Image

for (every pixel [x,y] in the layer) { if (mask[x,y] == 1) { new[x,y] = layer[x,y]; } else { new[x,y] = image[x,y]; }}

New

Moving a Layer

Moving a Layer 0 0 0 0 0 0 0 0 0 00 0 0 0 0 1 1 1 0 00 0 1 1 1 1 1 1 0 00 0 1 1 1 1 1 1 0 00 0 1 0 0 1 1 1 0 00 0 1 0 0 1 1 1 0 00 0 1 1 1 0 0 0 0 00 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0

Layer = mask+image 

Image

New

0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 1 1 10 0 0 0 1 1 1 1 1 10 0 0 0 1 1 1 1 1 10 0 0 0 1 0 0 1 1 10 0 0 0 1 0 0 1 1 10 0 0 0 1 1 1 0 0 00 0 0 0 0 0 0 0 0 0

Move layer pixels without touching image pixels

Cut

What happens to the deleted pixels?

Replace with background color

Picture Editing

Object representations of pictures

• Types of objects– Lines– Rectangles– Ovals– Text– Curves– Pictures

Text

Picture = 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)

Adding 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

Selecting 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

Deleting 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

Deleting 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 =

Why no missingpixels?

Deleting 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 =

Does object delete work like images or like text?

Moving 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

Moving 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

Changing 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

Move an object back

Move 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

Changing an imageSequoa -> Sequoia

Select the “a” with magic wand

Changing an imageSequoa -> Sequoia

Drag the “a” to the right

Leaves ugly blank pixels

Change using objects

Sequoa

Select text insertion point

Image object

Text object

Change using objects

SequoiaImage object

Text object

Compare

• 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

top related