# -*- coding: utf-8 -*-
"""
Created on Thu Feb 25 20:22:04 2021

@author: Md.Abdullah
"""

from PIL import Image

# reading the image

img=Image.open('J:\Digital-Image-Processing\Images/flower.jpg')
img.show()
print(img.size)

# color transforming
gray_image=img.convert("L")
gray_image.show()
gray_image.save('J:\Digital-Image-Processing\Images/gray_flower.jpg')
5773141c76c2e81622822944dafe05bf73594dd3
<mask token>

<mask token>
img.show()
print(img.size)
<mask token>
gray_image.show()
gray_image.save('J:\\Digital-Image-Processing\\Images/gray_flower.jpg')

<mask token>
img = Image.open('J:\\Digital-Image-Processing\\Images/flower.jpg')
img.show()
print(img.size)
gray_image = img.convert('L')
gray_image.show()
gray_image.save('J:\\Digital-Image-Processing\\Images/gray_flower.jpg')

<mask token>
from PIL import Image
img = Image.open('J:\\Digital-Image-Processing\\Images/flower.jpg')
img.show()
print(img.size)
gray_image = img.convert('L')
gray_image.show()
gray_image.save('J:\\Digital-Image-Processing\\Images/gray_flower.jpg')

# -*- coding: utf-8 -*-
"""
Created on Thu Feb 25 20:22:04 2021

@author: Md.Abdullah
"""

from PIL import Image

# reading the image

img=Image.open('J:\Digital-Image-Processing\Images/flower.jpg')
img.show()
print(img.size)

# color transforming
gray_image=img.convert("L")
gray_image.show()
gray_image.save('J:\Digital-Image-Processing\Images/gray_flower.jpg')