Skip to content

Commit f37fe11

Browse files
committed
micro tweak in images2
1 parent 3ff9abb commit f37fe11

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

notebooks/numpy-tps/images/.teacher/README-images2-corrige-nb.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def patchwork(raw_colors, side=5, background=[169, 169, 169]):
228228
colormap[:] = background
229229
# and we assign the array with the provided colors
230230
# remember the remaining ones are already set with the background
231-
colormap[0:nb_colors] = colors
231+
colormap[:nb_colors] = colors
232232
233233
# the final image is a rectangle of (l*side, c*side) of pixels
234234
# we compute its indices
@@ -579,9 +579,11 @@ plt.imshow(img_SEPIA);
579579
# np.dot ou @ (aka np.matmul)
580580
# https://numpy.org/doc/stable/reference/generated/numpy.dot.html
581581
582-
def sepia(im, SEPIA=np.array([[0.393, 0.349, 0.272],
583-
[0.769, 0.686, 0.534],
584-
[0.189, 0.168, 0.131]])):
582+
SEPIA = np.array([[0.393, 0.349, 0.272],
583+
[0.769, 0.686, 0.534],
584+
[0.189, 0.168, 0.131]])
585+
586+
def sepia(im):
585587
# les deux marchent
586588
result = np.dot(im, SEPIA)
587589
# result = im @ SEPIA

0 commit comments

Comments
 (0)