jammy.image package

Submodules

jammy.image.backend module

jammy.image.backend.imread(path)[source]
jammy.image.backend.imshow(title, image)[source]
jammy.image.backend.imwrite(path, image)[source]
jammy.image.backend.opencv_only(func)[source]
jammy.image.backend.opencv_or_pil(func)[source]
jammy.image.backend.pil_img2nd(image, require_chl3=True)[source]
jammy.image.backend.pil_nd2img(image)[source]
jammy.image.backend.pil_only(func)[source]
jammy.image.backend.resize(image, dsize, interpolation='LINEAR')[source]

jammy.image.codecs module

jammy.image.codecs.imdecode(data, *, require_chl3=True, require_alpha=False)[source]

Decode images in common formats (jpg, png, etc.).

Args:

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

jammy.image.codecs.jpeg_encode(img, quality=90)[source]

Encode the image with JPEG encoder.

Args:

img (numpy.ndarray): uint8 color image array quality (int): quality for JPEG compression

Returns bytes: encoded image data

jammy.image.codecs.png_encode(input, compress_level=3)[source]

Encode the image with PNG encoder.

Args:

img (numpy.ndarray): uint8 color image array quality (int): quality for JPEG compression

Returns bytes: encoded image data

jammy.image.imgio module

jammy.image.imgio.imgstack(imgs, dpi=128)[source]
jammy.image.imgio.imread(path, *, shuffle=False)[source]
jammy.image.imgio.imshow(title, img, *, shuffle=False)[source]
jammy.image.imgio.imwrite(path, img, *, shuffle=False)[source]
jammy.image.imgio.nd2pil(image)
jammy.image.imgio.ndimgs_in_row(list_x, n, dpi=128, img_size=400)[source]

args: list_x: list of elements that imshow can display n: number of the element in a row

jammy.image.imgio.pil2nd(image, require_chl3=True)
jammy.image.imgio.plt2nd(fig)[source]
jammy.image.imgio.plt2pil(fig)[source]

Convert a Matplotlib figure to a PIL Image and return it

jammy.image.imgio.savefig(fig, fig_name)[source]

jammy.image.imgproc module

jammy.image.imgproc.brightness(img, alpha)[source]
jammy.image.imgproc.center_crop(img, target_shape)[source]

center crop

jammy.image.imgproc.clip(img)[source]
jammy.image.imgproc.clip_decorator(func)[source]
jammy.image.imgproc.contrast(img, alpha)[source]
jammy.image.imgproc.crop(image, l, t, w, h, extra_crop=None)[source]
jammy.image.imgproc.dimshuffle(img, shuffle_type)[source]
jammy.image.imgproc.grayscale(img)[source]
jammy.image.imgproc.leftup_crop(img, target_shape)[source]

left-up crop

jammy.image.imgproc.resize(img, size, interpolation='LINEAR')[source]
jammy.image.imgproc.resize_minmax(img, min_dim, max_dim=None, interpolation='LINEAR')[source]
jammy.image.imgproc.resize_scale(img, scale, interpolation='LINEAR')[source]
jammy.image.imgproc.resize_scale_wh(img, scale_wh, interpolation='LINEAR')[source]
jammy.image.imgproc.resize_wh(img, size_wh, interpolation='LINEAR')[source]
jammy.image.imgproc.saturation(img, alpha)[source]

Module contents