jacinle.image.codecs#
Functions
|
Decode images in common formats (jpg, png, etc.). |
|
Encode the image with JPEG encoder. |
|
Encode the image with PNG encoder. |
Functions
- imdecode(data, *, require_chl3=True, require_alpha=False)[source]#
Decode images in common formats (jpg, png, etc.).
- Parameters:
data (bytes) – encoded image data
require_chl3 – whether to convert gray image to 3-channel BGR image
require_alpha – whether to add alpha channel to BGR image
Returns: uint8 color image array
- jpeg_encode(img, quality=90)[source]#
Encode the image with JPEG encoder.
- Parameters:
img (
numpy.ndarray
) – uint8 color image arrayquality (int) – quality for JPEG compression
Returns bytes: encoded image data
- png_encode(input, compress_level=3)[source]#
Encode the image with PNG encoder.
- Parameters:
img (
numpy.ndarray
) – uint8 color image arrayquality (int) – quality for JPEG compression
Returns bytes: encoded image data