I'm working with the MNIST dataset which contains black and white images of numbers. I am trying to change the numbers (white part) from white/gray to a different color, say red, in the same degree as the white. I've converted them into an rgb image instead of grayscale using opencv and packaged them into an array like this:
cImgsTrain = np.asarray([cv2.cvtColor(img.reshape(28,28),cv2.COLOR_GRAY2RGB) for img in x_train])
and
cImgsTrain.shape
outputs
(60000, 28, 28, 3)
60,000 images, each one 28x28 and three channels for rgb.
How would I change the first image in there, cImgsTrain[0], to go from this white version into a red version and have the whiter pixels be a deeper red and the grayer pixels a lighter shade? Is there a function that would help with this?

