I'm trying to load an image from the disk and then to extract just the red channel of it and display it in grayscale with grey colormap but I don't know what I'm doing wrong.. The image should be displayed as an rgb color, but if I'm using convert_colorspace it doesn't work.. This is my code:

# Import skimage and matplotlib
from skimage import io,color
import matplotlib.pyplot as plt

# Image loading
img = io.imread('lena.png')
# Displaying the original image

# Grayscale conversion
converted_img = color.convert_colorspace(,'RGB','RGB CIE')
# Data type of the grayscale image
# taking the red channel

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.