colour.io.write_image_Imageio#
- colour.io.write_image_Imageio(image: ArrayLike, path: str | PathLike, bit_depth: Literal['uint8', 'uint16', 'float16', 'float32', 'float64', 'float128'] = 'float32', **kwargs: Any) bytes | None[source]#
Write image data to the specified path using Imageio.
- Parameters:
image (ArrayLike) – Image data to write.
bit_depth (Literal['uint8', 'uint16', 'float16', 'float32', 'float64', 'float128']) – Bit-depth to write the image at. The image data is converted with
colour.io.convert_bit_depth()definition prior to writing.kwargs (Any) – Keywords arguments passed to the underlying Imageio
imwritefunction.
- Returns:
Image data written as bytes if successful,
Noneotherwise.- Return type:
Notes
Control how images are saved by the Freeimage backend using the
flagskeyword argument with desired values. See the Load / Save flag constants section in https://sourceforge.net/p/freeimage/svn/HEAD/tree/FreeImage/trunk/Source/FreeImage.h
Examples
>>> import os >>> import colour >>> path = os.path.join( ... colour.__path__[0], ... "io", ... "tests", ... "resources", ... "CMS_Test_Pattern.exr", ... ) >>> image = read_image(path) >>> path = os.path.join( ... colour.__path__[0], ... "io", ... "tests", ... "resources", ... "CMSTestPattern.tif", ... ) >>> write_image_Imageio(image, path) True