displayarray.effects

Crop

class Crop(output_size=(64, 64, 3), center=None)[source]

A callback class that will return the input array cropped to the output size. N-dimensional.

property center

Get the center.

enable_mouse_control()[source]

Move the mouse to move where the crop is from on the original image.

property output_size

Get the output size.

Lens

Create lens effects. Currently only 2D+color arrays are supported.

class Barrel(use_bleed=False, barrel_power=1, pincushion_power=1, zoom=1, center=None)[source]

A barrel lens distortion callback.

property barrel_power

Guarded barrel power. Avoids divide by zero conditions.

property center

Guarded get center. Limits to within input.

enable_mouse_control(crop_size=None)[source]

Enable the default mouse controls.

Move the mouse to center the image scroll to increase/decrease barrel ctrl+scroll to increase/decrease zoom

property zoom

Guarded zoom. Avoids divide by zero conditions.

class BarrelPyTorch(use_bleed=False, barrel_power=1, pincushion_power=1, zoom=1, center=None)[source]

A barrel distortion callback class accelerated by PyTorch.

class ControllableLens(use_bleed=False, zoom=1, center=None)[source]

A lens callback that can be controlled by the program or the user.

run_bleed(arr, x, y)[source]

Spread color outwards, like food coloring in water.

class Mustache(use_bleed=False, barrel_power=1, pincushion_power=1, zoom=1, center=None)[source]

A mustache distortion callback.

enable_mouse_control()[source]

Enable the default mouse loop to control the mustache distortion.

ctrl+scroll wheel: zoom in and out shift+scroll wheel: adjust pincushion power scroll wheel: adjust barrel power

class Barrel(use_bleed=False, barrel_power=1, pincushion_power=1, zoom=1, center=None)[source]

A barrel lens distortion callback.

property barrel_power

Guarded barrel power. Avoids divide by zero conditions.

property center

Guarded get center. Limits to within input.

enable_mouse_control(crop_size=None)[source]

Enable the default mouse controls.

Move the mouse to center the image scroll to increase/decrease barrel ctrl+scroll to increase/decrease zoom

property zoom

Guarded zoom. Avoids divide by zero conditions.

class Mustache(use_bleed=False, barrel_power=1, pincushion_power=1, zoom=1, center=None)[source]

A mustache distortion callback.

enable_mouse_control()[source]

Enable the default mouse loop to control the mustache distortion.

ctrl+scroll wheel: zoom in and out shift+scroll wheel: adjust pincushion power scroll wheel: adjust barrel power

Select Channels

class SelectChannels(selected_channels: Iterable[int] = None)[source]

Select channels to display from an array with too many colors.

Parameters

selected_channels – the list of channels to display.

enable_mouse_control()[source]

Enable mouse control.

Alt+Scroll to increase/decrease channel 2. Shift+Scroll to increase/decrease channel 1. Ctrl+scroll to increase/decrease channel 0.