pyufunc.img_to_bytes#

pyufunc.img_to_bytes(img_path)#

Convert image to bytes.

Parameters:

img_path (str) – image path, include all image format, e.g. .jpg, .png, .bmp, .gif, etc.

Returns:

the image bytes

Return type:

bytes

Example

>>> from pyufunc import img_to_bytes
>>> img_path = 'test.jpg'
>>> img_b = cvt_img_to_bytes(img_path)
>>> print(img_b)