imwrite
-
Description: Writes an image to a file, with optional color base conversion. If
pathisNone, it writes to a temporary file. -
Parameters
- img (
np.ndarray): Image array. - path (
str | Path | None): Output path. IfNone, writes to a temporary file. Default isNone. - color_base (
str): Current color base ofimg. If notBGR, it converts toBGRbefore writing. Default isBGR. - suffix (
str): Temp file suffix whenpathisNone. Default is.jpg.
- img (
-
Returns
- bool: Whether the write succeeded.
-
Example
import capybara as cb
img = cb.imread('lena.png')
cb.imwrite(img, 'lena.jpg')