Skip to main content

imdecode

imdecode(byte_: bytes) -> Union[np.ndarray, None]

  • Description: Decodes an image byte string into a NumPy image array.

  • Parameters:

    • byte_ (bytes): The image byte string to decode.
  • Return value:

    • np.ndarray: The decoded image array.
  • Example:

    import capybara as cb

    img = cb.imread('lena.png')
    encoded_bytes = cb.imencode(img, IMGTYP=cb.IMGTYP.PNG)
    decoded_img = cb.imdecode(encoded_bytes)