Python PIL | ImageChops.subtract() and ImageChops.subtract_modulo() method
PIL is the Python Imaging Library which provides the python interpreter with image editing capabilities.
ImageChops.subtract() method –
This method subtracts two images, dividing the result by scale and adding the offset. If omitted, scale defaults to 1.0, and offset to 0.0.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning - Basic Level Course
Syntax: ImageChops.subtract(image1, image2, scale = 1.0, offset = 0)
image1: first image
image2: second image
scale: it is floating point value (if the value keeps on increasing, resultant image becomes darker and darker)
offset: numeric value (if value keeps on increasing, resultant image becomes lighter)
Return Value: An Image
ImageChops.subtract_modulo() method –
This method is also used to subtract two images but without clipping the result.
Syntax: ImageChops.subtract_modulo(image1, image2)
Parameters: This method takes two images as parameters.
Return Value: An Image.