I have two images, and I want to animate a "swipe down" effect where each row of image 2 replaces each row of image 1. I think this involves substituting each pixel of 1st row of the 1st image by the 2nd one from top to bottom.
Here's a simple example that shows two grayscale images:
import matplotlib.pyplot as plt
import numpy as np
image2 = np.array([[200, 200, 200], [200, 200, 200], [200, 200, 200]])
image1 = np.array([[100, 100, 100], [100, 100, 100], [100, 100, 100]])
fig, ax = plt.subplots(2, 1)
ax[0].imshow(image2, cmap='gray', vmin=0, vmax=255)
ax[1].imshow(image1, cmap='gray', vmin=0, vmax=255)
plt.show()
But then I'm stuck. I'd like to animate the steps but I'm not sure how. Is it possible to do:
image2[row,column] = image1[row,column]