kaiju_images.functions module

Available operations (builtin)

Documentation

Operation

Pillow

Wand

OpenCV

resize(size)

crop(rect)

rotate(angle)

set_background_color_rgb(color)

auto_orient()

Available operations (custom)

Probably they will work with PIL type images only.

Operation

scale(factor) abs_scale(size) aspect_crop(ratio, rel_point) blur(size) flip_horizontal() flip_vertical() ===================================

aspect_crop(image, ratio, rel_shift=(0.5, 0.5))[source]

Crop image to a new aspect ratio.

Parameters:
  • image

  • ratio (Tuple[int, int]) – an integer ratio of new X:Y

  • rel_shift – default - centered, i.e. 0.5, 0.5

wand_blur(image)[source]
pillow_blur(image)[source]
scale(image, scale)[source]

Scale image.

Parameters:
  • image

  • scale (float) – new scale scale

abs_scale(image, size)[source]

Scales image so the longest dimension will become equal to size and the aspect ratio stays the same.

Parameters:
  • image

  • size (int) – size in px

pillow_flip_horizontal(image)[source]
pillow_flip_vertical(image)[source]
pillow_to_buffer_rgb(image)[source]
willow_to_buffer_rgb(image)[source]