week 11 image filtering Flashcards

1
Q

how do you import the image altering module?

A

from PIL import Image

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
1
Q

how do you open an image?

A

img = Image.open(filename + ‘.jpg’)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

how do you convert image to RGB?

A

img = Image.open(filename + ‘.jpg’).convert(‘RGB’)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

width of an image?

A

img.width

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

height of an image?

A

img.height

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

how do you access each pixel of a image

A

two for loops, one for rows and one for columns

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

how do you retrieve RGB for a pixel?

A

r, g, b = img.getpixel((col,row))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

how do you reinsert the altered pixel

A

img.putpixel((col, row), (r, g, b))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

how do you save an image?

A

img.save(‘filename’)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

how are images stored

A

in a 2d matrix of values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

pixel

A

individual elements that compile to the image

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

in a grayscale image, 255 is…

A

the whitest

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

in grayscale image, 0 is…

A

the darkest

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

RGB

A

3 values for red, green, and blue that comprise colors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

RBG(0, 0, 0)

A

black

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

RGB(255, 255, 255)

A

white

16
Q

grayscaling an image

A

set r b g to the average of the three values

17
Q

zero out filters

A

selecting a color and zeroing out the other two values

18
Q

adjusting layers filter

A

change the intensity of the color by multiplying it by a certain value

19
Q
A