module args.args_images

Short summary

module lightmlrestapi.args.args_images

Playground with images.

source on GitHub

Functions

function

truncated documentation

base642image

Gets an encoded image and builds an PIL.Image.Image from it.

bytes2string

Converts bytes to string.

image2array

Converts a color imaged into an array.

image2base64

Encodes an image into base64.

string2bytes

Converts string to bytes.

Documentation

Playground with images.

source on GitHub

lightmlrestapi.args.args_images.base642image(encoded)

Gets an encoded image and builds an PIL.Image.Image from it.

Parameters:

encodedbase64 encoded image (see image2base64)

Returns:

PIL.Image.Image

source on GitHub

lightmlrestapi.args.args_images.bytes2string(content)

Converts bytes to string.

source on GitHub

lightmlrestapi.args.args_images.image2array(img)

Converts a color imaged into an array.

Parameters:

imgPIL.Image.Image

Returns:

numpy.array

source on GitHub

lightmlrestapi.args.args_images.image2base64(path, fmt='png')

Encodes an image into base64.

Parameters:
  • path – filename or an image

  • fmt – if the image is given as an image (Pillow), it must be first saved in a specific format (png, jpg, …)

Returns:

format, base64

The format is the file extension.

source on GitHub

lightmlrestapi.args.args_images.string2bytes(content)

Converts string to bytes.

source on GitHub