4. Modules: Image Helpers¶
-
StreamDeck.ImageHelpers.PILHelper.
create_image
(deck, background='black')¶ Creates a new PIL Image with the correct image dimensions for the given StreamDeck device’s keys.
See also
See
to_native_format()
method for converting a PIL image instance to the native image format of a given StreamDeck device.Parameters: - deck (StreamDeck) – StreamDeck device to generate a compatible image for.
- background (str) – Background color to use, compatible with PIL.Image.new().
Return type: PIL.Image
Returns: Created PIL image
-
StreamDeck.ImageHelpers.PILHelper.
to_native_format
(deck, image)¶ Converts a given PIL image to the native image format for a StreamDeck, suitable for passing to
set_key_image()
.See also
See
create_image()
method for creating a PIL image instance for a given StreamDeck device.Parameters: - deck (StreamDeck) – StreamDeck device to generate a compatible native image for.
- image (PIL.Image) – PIL Image to convert to the native StreamDeck image format
Return type: enumerable()
Returns: Image converted to the given StreamDeck’s native format