io#
I/O functions for loading and saving images, textures.
|
Load a cube map texture from a list of images. |
|
Load an image texture from a file or URL. |
|
Load an image from a file or URL. |
|
Load an image from a file or URL as a wgpu Texture view. |
|
Save a 2D or 3D image to a file. |
load_cube_map_texture#
load_image_texture#
load_image#
load_image_as_wgpu_texture_view#
- fury.io.load_image_as_wgpu_texture_view(filename, device)[source]#
Load an image from a file or URL as a wgpu Texture view.
- Parameters:
filename (str) – Path to image file or URL. Should be png, bmp, jpeg or jpg files.
device (wgpu.GPUDevice) – The wgpu device to create the texture on.
- Returns:
Loaded image as wgpu Texture view.
- Return type:
wgpu.GPUTextureView
save_image#
- fury.io.save_image(arr, filename, *, compression_quality=75, compression_type='deflation', dpi=(72, 72))[source]#
Save a 2D or 3D image to a file.
- Parameters:
arr (ndarray) – Array to save with shape (H, W) or (H, W, 1) or (H, W, 3) or (H, W, 4).
filename (str) – Output filename. Should be png, bmp, jpeg, jpg, tiff, or tif file.
compression_quality (int, optional) – Compression quality for jpeg data. 0 = Low quality, 100 = High quality.
compression_type (str, optional) – Compression type for tiff file. Select between: None, lzw, deflation (default).
dpi (float or tuple of float, optional) – Dots per inch (dpi) for saved image. Single values are applied as dpi for both dimensions.