Learn Before
Concept

ImageMath Class (Pillow)

The ImageMath Class provides an eval() function that can be used for davanced image processing. The eval() function takes an expression in regular Python syntax, and an environment, which is a dictionary mapping names to images.

output = ImageMath.eval(expression, envionment)

The expression also supports a number of built-in functions specific to image processing:

  • abs(image) - Absolute value of an image
  • convert(image, mode) - Convert an image to a specified color mode
  • float(image) - Convert an image to a float
  • int(image) - Convert an image to a n int
  • max(image1, image2) - Maximum value of an image
  • min(image1, image2) - Minimum value of an image

0

1

Updated 2021-08-29

Contributors are:

Who are from:

Tags

Python Programming Language

Data Science