Skip to content

0.3.0

Choose a tag to compare

@markusressel markusressel released this 23 Oct 19:20
· 54 commits to main since this release
589aace

Behavior change

  • ImageModule.show_image_file and show_image_pixeldata send a PNG by default now (png=True). A raw RGB upload leaves a stray dark red pixel at the second LED of the first row of a 64x64 display, a PNG does not, and it is lossless for RGB and smaller. png=False sends raw RGB like the official app. Tested on a 64x64 only.

New

  • colors for GIFs and images (2 to 256): fewer colors make a GIF smaller, which means a faster upload.
  • colors="auto" for GIFs: tries palettes of 256 to 16 colors, each per frame and shared, scores them against the 256 color version (color difference plus flicker, idotmatrix.util.quality) and takes the smallest file that still looks fine. max_color_error sets the limit (default 5), shared_palette=True uses one palette for all frames.
  • max_size_kb for GIFs: reduces colors, then frames, until the GIF fits.
  • overlay=TextOverlay(...) draws a text on every frame of a GIF or on an image (a label, the time, a title). Positions, colors, a background and the font size can be set, and MaterialsModule.store takes a function to label each file.
  • MaterialsModule.store remembers what is in each slot and only transfers what is new, so storing the same list again takes a second instead of a minute. keep_order, clear_unused and verify control the details.

Fixes

  • Slots are no longer deleted before they are filled, so the display does not go dark in between.
  • ResizeMode.FIT no longer crashes on tiny canvases with a wide or tall picture, FILL is no longer a pixel short, and background_color is respected for images.

The conversion is tested with a broad set of generated media (noise, flat colors, 200+ frames, tiny and huge sizes, transparency, odd durations).