Image
Actions for handling image objects
Last updated
Actions for handling image objects
Last updated
Read image. Subclass of . Type of [Dict[str, Any], ]
name (Optional[str], optional): Name for identification. If equals to None, class name will be used. Defaults to None.
default_key (str, optional): What key will be used by default. Defaults to "image".
input_data (Dict[str, Any]): Expected keys:
"path_to_file" (str): Path to image file;
Exception: If unable to read image.
input_data (Dict[str, Any]): Expected keys:
"path_to_file" (str): Path to image file;
Exception: If unable to write image.
channels_mode (Literal["RGB", "RGBA", "L", "P", "PA", "CMYK"], optional): Channels mode to use. Defaults to "RGB".
name (Optional[str], optional): Name for identification. If equals to None, class name will be used. Defaults to None.
default_key (str, optional): What key will be used by default. Defaults to "image".
angle (float): Rotation angle in degrees.
expand (bool, optional): Optional expansion flag. If true, expands the output image to make it large enough to hold the entire rotated image. If false, make the output image the same size as the input image. Defaults to False. Note that the expand flag assumes rotation around the center and no translation.
center (Optional[Tuple[float, float]], optional): Optional center of rotation (a 2-tuple). Origin is the upper left corner. Default is the center of the image.
translate (Optional[Tuple[float, float]], optional): An optional post-rotate translation (a 2-tuple).
fillcolor (Optional[Any], optional): An optional color for area outside the rotated image.
name (Optional[str], optional): Name for identification. If equals to None, class name will be used. Defaults to None.
default_key (str, optional): What key will be used by default. Defaults to "image".
width (int): New width in pixels.
height (int): New height in pixels.
box (Optional[Tuple[float, float, float, float]], optional): An optional 4-tuple of floats providing the source image region to be scaled. The values must be within (0, 0, width, height) rectangle. If None, the entire source is used. Defaults to None.
reducing_gap (Optional[float], optional): Apply optimization by resizing the image in two steps. First, reducing the image by integer times using ~PIL.Image.Image.reduce. Second, resizing using regular resampling. The last step changes size no less than by reducing_gap times. reducing_gap may be None (no first step is performed) or should be greater than 1.0. The bigger reducing_gap, the closer the result to the fair resampling. The smaller reducing_gap, the faster resizing. With reducing_gap greater or equal to 3.0, the result is indistinguishable from fair resampling in most cases. Defaults to None (no optimization).
name (Optional[str], optional): Name for identification. If equals to None, class name will be used. Defaults to None.
default_key (str, optional): What key will be used by default. Defaults to "image".
width (int): New width in pixels.
height (int): New height in pixels.
centering (Tuple[float, float], optional): Control the position of the original image within the padded version. (0.5, 0.5) will keep the image centered (0, 0) will keep the image aligned to the top left (1, 1) will keep the image aligned to the bottom right.
name (Optional[str], optional): Name for identification. If equals to None, class name will be used. Defaults to None.
default_key (str, optional): What key will be used by default. Defaults to "image".
box (Tuple[int, int, int, int]): Bbox for crop. x0, y0, x1, y1, where x0, y0 - left top corner, x1, y1 - right bottom corner (relative in pixels).
name (Optional[str], optional): Name for identification. If equals to None, class name will be used. Defaults to None.
default_key (str, optional): What key will be used by default. Defaults to "image".
: Image.
Write image. Subclass of . Type of [Dict[str, Any], None]
"image" (): Image;
Convert image channels. Subclass of . Type of [, ]
input_data (): Image.
: Coverted image.
Rotate image. Subclass of . Type of [, ]
resample (, optional): An optional resampling filter. This can be one of (use nearest neighbour), Resampling.BILINEAR (linear interpolation in a 2x2 environment), or (cubic spline interpolation in a 4x4 environment). If the image has mode "1" or "P", it is set to . Defaults to .
input_data (): Image.
: Rotated image.
Resize image. Subclass of . Type of [, ]
resample (Optional[], optional): An optional resampling filter. This can be one of , , , , or . If the image has mode "1" or "P", it is always set to . If the image mode specifies a number of bits, such as "I;16", then the default filter is . Otherwise, the default filter is . Defaults to None.
input_data (): Image.
: Resized image.
Pad image. Subclass of . Type of [, ]
method (, optional): Resampling method to use. Default is .
input_data (): Image.
: Resized image.
Crop image. Subclass of . Type of [, ]
input_data (): Image.
: Croped image.