Answers for "convert rgb to grayscale python with numpy"

2

convert grayscale to rgb python

backtorgb = cv2.cvtColor(gray,cv2.COLOR_GRAY2RGB)
Posted by: Guest on November-01-2020
0

convert an image to grayscale python using numpy array

1
2
3
4
5
6
7
import numpy as np
from PIL import Image

im = np.array(Image.open('kolala.jpeg').convert('L')) #you can pass multiple arguments in single line
print(type(im))

gr_im= Image.fromarray(im).save('gr_kolala.png')
Posted by: Guest on December-11-2020

Code answers related to "convert rgb to grayscale python with numpy"

Python Answers by Framework

Browse Popular Code Answers by Language