First page Back Continue Last page Overview Graphics

Solution, Part 2

# at_img and decorators_img have to be of equal size:

d_shape = decorators_img.shape

at_shape = at_img.shape

height, width, colours = [min(x) for x in zip(*(d_shape, at_shape))]

at_img = at_img[0:height, 0:width]

tinted_decorator_img = shade(decorators_img, 0.5)

img2 = np.where(at_img > [0.1, 0.1, 0.1],

decorators_img,

tinted_decorator_img)

plt.axis("off")

plt.imshow(img2)

plt.show()