Learn Before
  • Image Processing with Pillow

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

4 years ago

Contributors are:

Who are from:

Tags

Python Programming Language

Data Science

Related
  • Pillow Documentation

  • Image Class (Pillow)

  • Color Modes

  • Bands (Pillow)

  • ImageDraw Class (Pillow)

  • ImageChops Class (Pillow)

  • ImageOps Class (Pillow)

  • ImageGrab Class (Pillow)

  • ImageMath Class (Pillow)

  • ImagePath Class (Pillow)

  • ImageShow Class (Pillow)

Learn After
  • ImageMath Class Example (Python)