I want to save an image without any channel, so the dimension would only be 2. Thus, is there a way I do it in matplotlib?
I have already tried using
matplotlib.pyplot.imsave('img.png', image, cmap='gray')
but when I read it using
matplotlib.pyplot.imread('img.png')
The dimension is 3. So I'm confusing how. I know maybe I can't use imread but what can I do instead?