Skip to main content

imdecode

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

  • Description: Decode an image byte string to a NumPy image array.

  • Parameters

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

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

    import docsaidkit as D

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