| import matplotlib.pyplot as plt | |
| plt.figure(figsize=(10, 5)) | |
| plt.subplot(1, 2, 1) | |
| plt.imshow(black_white_image, cmap='gray') | |
| plt.title('Original Image') | |
| plt.axis('off') | |
| plt.subplot(1, 2, 2) | |
| plt.imshow(tmp, cmap='gray') | |
| plt.title('Output Image with Black Patches') | |
| plt.axis('off') | |
| plt.show() |