I\'m trying to use matplotlib to read in an RGB image and convert it to grayscale.
matplotlib
In matlab I use this:
img = rgb2gray(imread(\'image.p
The fastest and current way is to use Pillow, installed via pip install Pillow.
pip install Pillow
The code is then:
from PIL import Image img = Image.open('input_file.jpg').convert('L') img.save('output_file.jpg')