I have a question about RGB color change related to Python 3 image!

Asked 2 years ago, Updated 2 years ago, 102 views

Hello, I just studied Python.

I looked up a lot of image RGB changes on Python with Google.

You usually use PIL or WAND.

I don't know how to change it Leave a question! What should I use on Python 3?

In the case of wand, I think it's only possible in Python 2.

I'd appreciate it if you could explain it in detail.

To Python - Before Image Change

-After changing the image

python pycharm rgb python3

2022-09-22 08:39

1 Answers

Check out the pillow.

I tried pip3 install Pillow on my mac and the following code worked well. Code for black-and-white conversion.

from PIL import Image
img = Image.open('image.png').convert('LA')
img.save('greyscale.png')

Please refer to this link for instructions and installation on other platforms and for installation on other platforms.


2022-09-22 08:39

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.