PIL is the Python Imaging Library which provides the python interpreter with image editing capabilities. The Image
module provides a class with the same name which is used to represent a PIL image. The module also provides a number of factory functions, including functions to load images from files, and to create new images.
PIL.ImageChops.constant()
Fill a channel with a given grey level.
Syntax: PIL.ImageChops.constant(image, value)
Parameters:
image– take an image with there extension type.
Returns: An Image.
Image Used:

from PIL import Image, ImageChops
img = Image. open (r "C:\Users\System-Pc\Desktop\TREE.JPG" )
img1 = ImageChops.constant(img, 60 )
img1.show()
|
Output:

Another Example:Taking another image with different value to see the change in grey intensity.
Image Used:

from PIL import Image, ImageChops
img = Image. open (r "C:\Users\System-Pc\Desktop\rose.jpg" )
img1 = ImageChops.constant(img, 200 )
img1.show()
|
Output:

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out -
check it out now!
Last Updated :
26 Aug, 2019
Like Article
Save Article