Image Buffer (imbuf)
This module provides access to Blender’s image manipulation API.
It provides access to image buffers outside of Blender’s
bpy.types.Image
data-block context.
Submodules
- imbuf.load(filepath)
Load an image from a file.
- Parameters
filepath (str | bytes) – the filepath of the image.
- Returns
the newly loaded image.
- Return type
ImBuf
- imbuf.load_from_buffer(buffer)
Load an image from a buffer.
- Parameters
buffer (collections.abc.Buffer) – A buffer containing the image data.
- Returns
the newly loaded image.
- Return type
ImBuf
- imbuf.new(size)
Load a new image.
- Parameters
size (tuple[int, int]) – The size of the image in pixels.
- Returns
the newly loaded image.
- Return type
ImBuf
- imbuf.write(image, filepath=image.filepath)
Write an image.
- Parameters
image (
ImBuf
) – the image to write.filepath (str | bytes | None) – Optional filepath of the image (fallback to the images file path).