Module¶
transfer
¶
Part of the sphinx build process in generate and index file: Index.
-
class
transfer.
Transfer
(base_path: str, goal_path: str, base_filter='*', goal_filter='*', exclude=[], include=[], out_path='out', size=None, verbose=True, tint=False, colour=None, merge=0, brightness=1.0, contrast=1.0, sharpness=1.0, tint_threshold=100)¶ Transfer object to transfer pixel information from one image to another.
- Parameters
base_path (str) – path to the base image or folder
goal_path (str) – path to the goal image or folder
base_filter (str, optional) – filter to be used on the base image, defaults to “*”
goal_filter (str, optional) – filter to be used on the goal image, defaults to “*”
exclude (list, optional) – list of names to be excluded from the input, defaults to []
include (list, optional) – list of names to be included by the input, defaults to []
out_path (str, optional) – path where the result should be stored, defaults to “out”
size ([int], optional) – size tuple [width, height] if you want the result to be resized, defaults to None
verbose (bool, optional) – if you want a output to the console, defaults to True
tint (bool, optional) – if you want to tint the image, defaults to False
colour (str, optional) – Specific colour of the tint. If not given but tint is true, the majority colour of the image will be used, defaults to None
merge (int, optional) – percentage [0-100] of merging the goal image into the base, defaults to 0
brightness (float, optional) – enhancement factor for the brightness: 0.0 is black, 1.0 is normal and > 1.0 is brighter, defaults to 1.0
contrast (float, optional) – enhancement factor for the contrast: 0.0 is grey, 1.0 is normal and > 1.0 is more contrast, defaults to 1.0
sharpness (float, optional) – enhancement factor for the sharpness: 0.0 is smooth, 1.0 is normal and > 1.0 is sharper, defaults to 1.0
tint_threshold (int, optional) – threshold for the alpha value (0-255) to calculate the majority colour., defaults to 100
-
createImage
(base_image_path: pathlib.Path, goal_image_path: pathlib.Path, out_path='out') → None¶ Create an pixel transfer image.
- Parameters
base_image_path (Path) – path to the base image
goal_image_path (Path) – path to the goal image
out_path (str, optional) – path where the result will be saved, defaults to “out”
- Raises
TypeError – if base image is not RGB or RGBA
TypeError – if goal image is not RGBA
-
run
()¶ Run the transfer module with the previous given values.
-
transfer.
get_parser
() → object¶