Skip to main content
`Ctrl`+`K`

# imageio.plugins.opencv.OpenCVPlugin.write

OpenCVPlugin.write(ndimage: ArrayLike | List[ArrayLike], is_batch: bool = False, params: List[int] = None) → bytes | None

  Save an ndimage in the ImageResource.

  Parameters:
    ndimage ArrayLike, List[ArrayLike]

      The image data that will be written to the file. It is either a single image, a batch of images, or a list of images.

    is_batch bool

      If True, the provided ndimage is a batch of images. If False (default), the provided ndimage is a single image. If the provided ndimage is a list of images, this parameter has no effect.

    params List[int]

      A list of parameters that will be passed to OpenCVs imwrite or imwritemulti functions. Possible values are documented in the OpenCV documentation.

  Returns:
    encoded_image bytes, None

      If the ImageResource is `"<bytes>"` the call to write returns the encoded image as a bytes string. Otherwise it returns None.