HSL

Description

This section is focused around color & its manipulation. In simple terms, hue refers to the color itself, saturation to its intensity, and light to how bright or dark the color is. This module provides functions that edit the hue, saturation, and light of an image in a variety of ways.

Function List

pyifx.hsl.brighten(img_paths, percent=45, write=True)

Takes image(s) and brightens them.

Parameters:
  • img_paths (pyifx.misc.PyifxImage, pyifx.misc.ImageVolume, list) – The image(s) to be brightened.
  • percent (int) – How much the image(s) should be brightened. If nothing is entered for this parameter, it will default to 45. The parameter must be between 0 and 100 (inclusive).
  • write (bool) – Whether to write the brightened image(s).
Returns:

PyifxImage instance, ImageVolume instance, or list with elements of type PyifxImage

Return type:

pyifx.misc.PyifxImage, pyifx.misc.ImageVolume, list

pyifx.hsl.color_overlay(img_paths, color, opacity=30, write=True)

Takes image(s) and applies a specified color over it/them.

Parameters:
  • img_paths (pyifx.misc.PyifxImage, pyifx.misc.ImageVolume, list) – The image(s) to be manipulated.
  • color (numpy.ndarray, list) – The color to be applied over the image(s). This parameter should be specified in the format [Red, Green, Blue], with each component being between 0 and 255 (inclusive).
  • opacity (int) – How visible the color should be. If nothing is entered for this parameter, it will default to 30. It should be between 0 and 100 (inclusive).
  • write (bool) – Whether to write the darkened image(s).
Returns:

PyifxImage instance, ImageVolume instance, or list with elements of type PyifxImage

Return type:

pyifx.misc.PyifxImage, pyifx.misc.ImageVolume, list

pyifx.hsl.darken(img_paths, percent=45, write=True)

Takes image(s) and darkens them.

Parameters:
  • img_paths (pyifx.misc.PyifxImage, pyifx.misc.ImageVolume, list) – The image(s) to be darkened.
  • percent (int) – How much the image(s) should be darkened. If nothing is entered for this parameter, it will default to 45. The parameter must be between 0 and 100 (inclusive).
  • write (bool) – Whether to write the darkened image(s).
Returns:

PyifxImage instance, ImageVolume instance, or list with elements of type PyifxImage

Return type:

pyifx.misc.PyifxImage, pyifx.misc.ImageVolume, list

pyifx.hsl.desaturate(img_paths, percent=30, write=True)

Takes image(s) and desaturates them.

Parameters:
  • img_paths (pyifx.misc.PyifxImage, pyifx.misc.ImageVolume, list) – The image(s) to be desaturated.
  • percent (int) – How much the image(s) should be desaturated. If nothing is entered for this parameter, it will default to 30. The parameter must be between 0 and 100 (inclusive).
  • write (bool) – Whether to write the desaturated image(s).
Returns:

PyifxImage instance, ImageVolume instance, or list with elements of type PyifxImage

Return type:

pyifx.misc.PyifxImage, pyifx.misc.ImageVolume, list

pyifx.hsl.saturate(img_paths, percent=30, write=True)

Takes image(s) and saturates them.

Parameters:
  • img_paths (pyifx.misc.PyifxImage, pyifx.misc.ImageVolume, list) – The image(s) to be saturated.
  • percent (int) – How much the image(s) should be saturated. If nothing is entered for this parameter, it will default to 30. The parameter must be between 0 and 100 (inclusive).
  • write (bool) – Whether to write the saturated image(s).
Returns:

PyifxImage instance, ImageVolume instance, or list with elements of type PyifxImage

Return type:

pyifx.misc.PyifxImage, pyifx.misc.ImageVolume, list

pyifx.hsl.to_grayscale(img_paths, write=True)

Takes image(s) and converts them to grayscale.

Parameters:
Returns:

PyifxImage instance, ImageVolume instance, or list with elements of type PyifxImage

Return type:

pyifx.misc.PyifxImage, pyifx.misc.ImageVolume, list