Reputation: 431
This is my code:
img = cv2.imread(some_path, 0)
Original image:
After running the code:
Obviously losing a lot of transparency.
Upvotes: 0
Views: 661
Reputation: 665
You can use PILLOW:
from PIL import Image
img = Image.open('image_to_grayscale.png').convert('LA')
img.save('greyscale.png')
Result:
Upvotes: 4