Skip to content

Commit b3d9a8e

Browse files
authored
Update img_avg.py
1 parent 1ba822f commit b3d9a8e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

2_intermediate/chapter10/practice/img_avg.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
""" Here is the challenge problem for 2d loops>
1+
""" Here is the challenge problem for 2d loops:
22
Images are often represented as 3d arrays,
33
where the rows and columns are the pixels in the image,
44
and each pixel has an r, g, and b value.
@@ -8,9 +8,9 @@
88
will return a different image where each pixel is the average
99
of the pixels surrounding it in the original image.
1010
11-
The neighbors of an image are all the pixels that surroun it,
12-
1 on each side, and 4 on the diagonals, for 8 in total.
13-
Each pixel doesn't necessarily have 8 neighbors, though (think about why)
11+
The neighbors of an image are all the pixels that surround it,
12+
1 on each side, and 4 on the diagonals, for 8 in total. Each
13+
pixel doesn't necessarily have 8 neighbors, though (think about why)
1414
1515
The code to grab an image from the internet and make it
1616
into an array is given to you. The code also displays the new image
@@ -20,8 +20,8 @@
2020
To find the average value of all of a pixels neighbors, you must
2121
change the average of the red value to the red value, blue to blue, etc.
2222
For example, if the neighbors of a pixel with value [1,2,3]
23-
were [20,30,40] and [10,120,30], the new pixel that would replace the original one would be
24-
[15,75,35]
23+
were [20,30,40] and [10,120,30], the new pixel that would replace the
24+
original one would be [15,75,35]
2525
"""
2626

2727
from PIL import Image

0 commit comments

Comments
 (0)