Units

For converting between things that are the same thing but have different numbers and shapes

Classes

Color(convert_from, convert_to[, output_scale])

Convert colors using the colorsys module!!

Colorspaces(value)

An enumeration.

Rescale(in_range, float] =, out_range, float] =)

Rescale values from one range to another

class Rescale(in_range: Tuple[float, float] = 0, 1, out_range: Tuple[float, float] = 0, 1, clip=False, *args, **kwargs)[source]

Bases: autopilot.transform.transforms.Transform

Rescale values from one range to another

Attributes

format_in

dict() -> new empty dictionary

format_out

dict() -> new empty dictionary

Methods

process(input)

Subtract input minimum, multiple by output/input size ratio, add output minimum

format_in = {'type': (<class 'numpy.ndarray'>, <class 'float'>, <class 'int'>, <class 'tuple'>, <class 'list'>)}
format_out = {'type': <class 'numpy.ndarray'>}
process(input)[source]

Subtract input minimum, multiple by output/input size ratio, add output minimum

class Colorspaces(value)[source]

Bases: enum.Enum

An enumeration.

Attributes

HSV

int([x]) -> integer

RGB

int([x]) -> integer

YIQ

int([x]) -> integer

HLS

int([x]) -> integer

HSV = 1
RGB = 2
YIQ = 3
HLS = 4
class Color(convert_from: autopilot.transform.units.Colorspaces = <Colorspaces.HSV: 1>, convert_to: autopilot.transform.units.Colorspaces = <Colorspaces.RGB: 2>, output_scale=255, *args, **kwargs)[source]

Bases: autopilot.transform.transforms.Transform

Convert colors using the colorsys module!!

Note

All inputs must be scaled (0,1) and all outputs will be (0,1)

Attributes

CONVERSIONS

dict() -> new empty dictionary

format_in

dict() -> new empty dictionary

format_out

dict() -> new empty dictionary

Methods

process(input, *args)

format_in = {'type': <class 'tuple'>}
format_out = {'type': <class 'tuple'>}
CONVERSIONS = {<Colorspaces.RGB: 2>: {<Colorspaces.YIQ: 3>: <function rgb_to_yiq>, <Colorspaces.HLS: 4>: <function rgb_to_hls>, <Colorspaces.HSV: 1>: <function rgb_to_hsv>}, <Colorspaces.YIQ: 3>: {<Colorspaces.RGB: 2>: <function yiq_to_rgb>}, <Colorspaces.HLS: 4>: {<Colorspaces.RGB: 2>: <function hls_to_rgb>}, <Colorspaces.HSV: 1>: {<Colorspaces.RGB: 2>: <function hsv_to_rgb>}}
process(input, *args)[source]