img.codecs
wavelet_buffer.img.BaseCodec
¶
Interface for codes to decode/encode images from/to different image formats
channel_number()
¶
Return number ofr channel RGB=3, Gray=1
decode(blob)
¶
Decode an image from bytes to a numpy image
Parameters:
Name | Type | Description | Default |
---|---|---|---|
blob |
bytes
|
serialized image e.g. JPEG |
required |
Returns:
Type | Description |
---|---|
np.ndarray[np.float32]
|
image as numpy array |
encode(data, start_channel=0)
¶
Encode a numpy image to byte string
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
np.ndarray[np.float32]
|
numpy image |
required |
start_channel |
int
|
start channel for conversion |
0
|
Returns:
Type | Description |
---|---|
bytes
|
serialized image e.g. JPEG |
wavelet_buffer.img.RgbJpeg
¶
Codec for JPEG <-> numpy RGB image conversion
__init__(write_quality=1.0)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
write_quality |
float
|
quality of encoded image. Should be from 0 to 1.0 |
1.0
|