-
-
Save stephengruppetta/d49a9ed0419968acaa8cf627743fe68b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
image = plt.imread("gardens.jpg") | |
# Create a figure with two subplots | |
fig, (ax_left, ax_right) = plt.subplots(nrows=1, ncols=2) | |
ax_left.imshow(image) | |
ax_left.axis("off") | |
# Extract the red channel from the image | |
image_red = image.copy() | |
image_red[:, :, 1:] = 0 | |
ax_right.imshow(image_red) | |
ax_right.axis("off") | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment