Graphics¶
Description¶
This section focuses on the look and composition of images as a whole. Functions in this section mostly apply effects to images to change their look, such as blurs and pixelations. This section covers a wider variety of tools compared to the HSL module.
Function List¶
-
pyifx.graphics.
blur_gaussian
(img_paths, radius=3, size=None, write=True)¶ Takes images(s) and blurs them using a gaussian kernel based on a given radius.
Parameters: - img_paths (pyifx.misc.PyifxImage, pyifx.misc.ImageVolume, list) – The image(s) to be blurred.
- radius (int) – The radius of the gaussian kernel. If nothing is entered for this parameter, it will default to 3.
- size (list, NoneType) – The dimensions of the gaussian kernel. Must be entered in
- write (bool) – Whether to write the blurred image(s).
Returns: PyifxImage instance, ImageVolume instance, or list with elements of type PyifxImage
Return type:
-
pyifx.graphics.
blur_mean
(img_paths, radius=3, write=True)¶ Takes images(s) and blurs them using a mean kernel based on a given radius.
Parameters: - img_paths (pyifx.misc.PyifxImage, pyifx.misc.ImageVolume, list) – The image(s) to be blurred.
- radius (int) – The radius of the mean kernel. If nothing is entered for this parameter, it will default to 3.
- write (bool) – Whether to write the blurred image(s).
Returns: PyifxImage instance, ImageVolume instance, or list with elements of type PyifxImage
Return type:
-
pyifx.graphics.
convolute_custom
(img_paths, kernel, write=True)¶ Takes image(s) and creates new images that are convoluted over using a given kernel.
Parameters: - img_paths (pyifx.misc.PyifxImage, pyifx.misc.ImageVolume, list) – The image(s) to be convoluted over.
- kernel (numpy.ndarray, list) – The kernel to be used for convolution. This can be provided in either a 2-dimensional list or a numpy 2-dimensional array.
- write (bool) – Whether to write the convoluted image(s).
Returns: PyifxImage instance, ImageVolume instance, or list with elements of type PyifxImage
Return type:
-
pyifx.graphics.
detect_edges
(img_paths, write=True)¶ Takes image(s) and creates new images focusing on edges.
Parameters: - img_paths (pyifx.misc.PyifxImage, pyifx.misc.ImageVolume, list) – The image(s) to be manipulated.
- write (bool) – Whether to write the manipulated image(s).
Returns: PyifxImage instance, ImageVolume instance, or list with elements of type PyifxImage
Return type:
-
pyifx.graphics.
pixelate
(img_paths, factor=4, write=True)¶ Takes image(s) and pixelates them based on a given factor.
Parameters: - img_paths (pyifx.misc.PyifxImage, pyifx.misc.ImageVolume, list) – The image(s) to be pixelated.
- factor (int) – How much the image(s) should be pixelated. If nothing is entered for this parameter, it will default to 4.
- write (bool) – Whether to write the pixelated image(s).
Returns: PyifxImage instance, ImageVolume instance, or list with elements of type PyifxImage
Return type: