stouputils.image package#

This module provides little utilities for image processing.

  • relative_luminance() - Perceived brightness of a colour, as the sRGB relative luminance.

  • readable_text_color() - Pick the text colour that stays readable on a given background.

  • auto_crop() - Automatically crop an image to remove zero/uniform regions.

  • numpy_segments_to_obj() - Generate a ‘.obj’ file from multiple 3D segmentation arrays, each with its own color.

  • numpy_to_gif() - Generate a ‘.gif’ file from a 3D numpy array for visualization.

  • numpy_to_obj() - Generate a ‘.obj’ file from a 3D numpy array using marching cubes.

  • image_resize() - Resize an image while preserving its aspect ratio by default.

Submodules#