gifio
– Access GIF-format images¶
Available on these boards
- class gifio.GifWriter(file: BinaryIO | str, width: int, height: int, colorspace: displayio.Colorspace, loop: bool = True, dither: bool = False)¶
Construct a GifWriter object
- Paramètres:
file – Either a file open in bytes mode, or the name of a file to open in bytes mode.
width – The width of the image. All frames must have the same width.
height – The height of the image. All frames must have the same height.
colorspace – The colorspace of the image. All frames must have the same colorspace. The supported colorspaces are
RGB565
,BGR565
,RGB565_SWAPPED
,BGR565_SWAPPED
, andL8
(greyscale)loop – If True, the GIF is marked for looping playback
dither – If True, and the image is in color, a simple ordered dither is applied.
- __exit__() None ¶
Automatically deinitializes the hardware when exiting a context. See Lifetime and ContextManagers for more info.
- add_frame(bitmap: _typing.ReadableBuffer, delay: float = 0.1) None ¶
Add a frame to the GIF.
- Paramètres:
bitmap – The frame data
delay – The frame delay in seconds. The GIF format rounds this to the nearest 1/100 second, and the largest permitted value is 655 seconds.