You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: components/animation.rst
+6-9
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,7 @@ It adds additional lambda methods: ``next_frame()``, ``prev_frame()`` and ``set_
12
12
- file: "animation.gif"
13
13
id: my_animation
14
14
resize: 100x100
15
+
type: RGB565
15
16
16
17
The animation can be rendered just like the image component with the ``image()`` function of the display component.
17
18
@@ -50,18 +51,15 @@ Configuration variables:
50
51
in your display code.
51
52
- **resize** (*Optional*, string): If set, this will resize all the frames to fit inside the given dimensions ``WIDTHxHEIGHT``
52
53
and preserve the aspect ratio.
53
-
- **type** (*Optional*): Specifies how to encode each frame internally. Defaults to ``BINARY``.
54
+
- **type** (**Required**): Specifies how to encode image internally. See the :ref:`image component <display-image>` for more information.
54
55
55
56
- ``BINARY``: Two colors, suitable for 1 color displays or 2 color image in color displays. Uses 1 bit
56
-
per pixel, 8 pixels per byte.
57
-
- ``TRANSPARENT_BINARY``: One color, any pixel that is fully transparent will not be drawn, and any other pixel
58
-
will be the on color. Uses 1 bit per pixel, 8 pixels per byte.
57
+
per pixel, 8 pixels per byte. Only ``chroma_key`` transparency is available.
59
58
- ``GRAYSCALE``: Full scale grey. Uses 8 bits per pixel, 1 pixel per byte.
60
-
- ``RGB565``: Lossy RGB color stored. Uses 2 bytes per pixel.
61
-
- ``RGB24``: Full RGB color stored. Uses 3 bytes per pixel.
62
-
- ``RGBA``: Full RGB color stored. Uses 4 bytes per pixel. Any pixel with an alpha value < 127 will not be drawn.
59
+
- ``RGB565``: Lossy RGB color stored. Uses 2 bytes per pixel, 3 with an alpha channel.
60
+
- ``RGB``: Full RGB color stored. Uses 3 bytes per pixel, 4 with an alpha channel.
63
61
64
-
- **use_transparency** (*Optional*): If set the alpha channel of the input image will be taken into account, and pixels with alpha < 127 will not be drawn. For image types without explicit alpha channel, the color (0, 0, 1) (very dark blue) will be mapped to black, to be able to store transparency information within the image. Explicitly transparent types (``TRANSPARENT_BINARY`` and ``RGBA``) default to ``True`` and cannot be set to ``False``; other types default to ``False``.
62
+
- **transparency** (*Optional*): If set the alpha channel of the input image will be taken into account. The possible values are ``opaque`` (default), ``chroma_key`` and ``alpha_channel``. See discussion on transparency in the :ref:`image component <display-image>`.
65
63
- **loop** (*Optional*): If you want to loop over a subset of your animation (e.g. a fire animation where the fire "starts", then "burns" and "dies") you can specify some frames to loop over.
66
64
67
65
- **start_frame** (*Optional*, int): The frame to loop back to when ``end_frame`` is reached. Defaults to the first frame in the animation.
@@ -83,4 +81,3 @@ Actions:
83
81
84
82
- **id** (**Required**, :ref:`config-id`): The ID of the animation to animate.
85
83
- **frame** (**Required**, int): The frame index to show next.
0 commit comments