v4.5.1

v4.5.1 adds image orientation/aspect drawing hints, loading images directly from a file path, a GC2145 wide field-of-view ioctl, and a new backlight controller API. It also reworks the Image() constructor, display APIs, and module argument parsing — read the breaking changes below.

Highlights

  • Drawing hintsdraw_image() gained orientation (HMIRROR/VFLIP/TRANSPOSE, ROTATE_90/180/270) and aspect-scaling (SCALE_ASPECT_KEEP/EXPAND/IGNORE) hints.

  • Load images from diskdraw_image() / display.write() accept a file-path string.

  • Backlight control — new DACBacklight / PWMBacklight classes and a display backlight= argument.

  • Breaking: the Image() constructor, display APIs, and module argument parsing changed — see the breaking changes.

New features

  • draw_image() orientation hints — image.HMIRROR, image.VFLIP, image.TRANSPOSE, plus convenience image.ROTATE_90 / ROTATE_180 / ROTATE_270.

  • draw_image() aspect hints — image.SCALE_ASPECT_KEEP / SCALE_ASPECT_EXPAND / SCALE_ASPECT_IGNORE for fit / expand / stretch.

  • Palette constantsimage.PALETTE_RAINBOW and image.PALETTE_IRONBOW (moved into the image module).

  • Wide field of view — new sensor.IOCTL_SET_FOV_WIDE / IOCTL_GET_FOV_WIDE ioctls (on the GC2145, up to 5x sensor scaling).

  • Load from diskdraw_image() and display.write() accept a source-image file-path string, loading it from storage directly.

  • Backlight controllers — new DACBacklight and PWMBacklight classes (importable from display), and a keyword-only backlight= argument on the SPI/parallel display constructors.

Other changes and improvements

  • The ST7701 DSI display driver moved into its own st7701.py module (still importable via from display import *) and is frozen on Arduino Giga; the lsm9ds1 IMU driver was frozen on the Arduino Nano 33 BLE Sense.

  • MT9V022 / MT9V034 (global-shutter) cameras now apply row-noise correction for better image quality.

  • The i.MX RT USB mass-storage volume is now labelled as an OpenMV disk.

Bug fixes

Camera and sensors:

  • Fixed corner detection (find_keypoints() FAST/AGAST) on images taller than 480 rows — the per-row buffer is now sized to the image height.

  • Added FSYNC-pin support for frame-synchronized snapshot() on i.MX RT (OpenMV RT1060), and fixed swapped SPI4 MOSI/MISO pins on the RT1060.

Display and video:

  • Corrected the SPIDisplay constructor argument order (bgr, byte_swap, triple_buffer were applied to the wrong parameters).

  • Fixed TV-shield image corruption when drawing an image with a specified rectangle, and incorrect MJPEG frame bounds when recording scaled frames.

Networking:

  • WINC WiFi AP mode no longer enforces the obsolete WEP-only restriction — open and WPA AP modes work with proper PSK handling.

Hardware and board support

  • OpenMV RT1060 — FSYNC pin and corrected SPI4 pins.

  • Arduino GIGA — QSPI reliability workaround; ST7701 display frozen in.

  • Arduino Nano 33 BLE Senselsm9ds1 IMU driver frozen in.

Breaking API changes

User-visible API breaks between v4.5.0 and v4.5.1. Scope: Python C-modules in modules/ and Python libraries in scripts/libraries/.

Each change is tagged with its impact:

  • minor — narrow API; only affects scripts that used it.

  • behavior — same API, different results; re-check tuned scripts.

Changes are grouped by impact in that order. If you just want to port your code, jump to the migration checklist at the end. Each commit hash links to its diff on GitHub.

Image() constructor and display APIs (minor)

The image.Image constructor was reworked to keyword arguments (height, pixformat, buffer=, copy_to_fb=); it can now build an image from an existing bytearray/buffer, and a buffer is required for compressed formats. display.write() was reworked: x_scale/y_scale now take a float (scale ratio) or int (target size in pixels) and the separate x_size/y_size keywords were removed. The WINC.connect() first positional argument was renamed essidssid, and WINC WiFi scan results changed to (ssid_bytes, bssid_bytes, channel, rssi, security, N) (SSID/BSSID are now bytes; BSSID is no longer a formatted MAC string).

Commits: 6752c95ac, 161737092, 8178c237c, b6cdf8de1

Backlight range, scaling, and keyword-only arguments (behavior)

Display.backlight() now takes a 0–100 intensity (0 = off, 100 = full) instead of 0–255, raising ValueError out of range. Integer x_scale/y_scale values are now treated as a multiplicative scale factor (the same as floats) rather than a target pixel dimension — this affects fir.snapshot()/draw_ir(), tof.snapshot()/ draw_depth(), display, and tv scaling. Argument parsing across the sensor, fir, tof, tv, mjpeg, gif, imageio, tf, and audio modules was unified, making several previously-positional options keyword-only (names, defaults, and behavior are otherwise unchanged).

Commits: 391ec443f, 8bd25d6cd, 477312656, 08bf62a32, a4c0f20bf, 9b411a66d, 3d679f5a6, d15fc6b8d, 555e67ecd

Migration checklist

For a clean port to v4.5.1 the typical work is:

  1. Update Image() construction to the new keyword form, switch display.write() off x_size/y_size, and rename WINC.connect() essidssid (handle the new bytes-based scan tuples) (the constructor/display/WINC changes).

  2. Rescale Display.backlight() calls to 0–100, re-check any integer x_scale/y_scale usage, and pass formerly-positional module options as keywords (the behavior changes).