Skip to content

v2.1.0

Latest

Choose a tag to compare

@wkentaro wkentaro released this 10 Jun 08:52
· 24 commits to main since this release
586d6b1

Released on 2026-06-10.

Highlights

flags2rgb visualizes per-instance boolean flags as pie glyphs with a legend, where wedge color (and optionally angle) encodes flag identity:

import imgviz

viz = imgviz.flags2rgb(
    image=image,                          # (H, W, 3) uint8
    flags=flags,                          # (N, F) bool
    centers=centers,                      # (N, 2) [(cy, cx), ...]
    flag_names=["occluded", "grasped", "verified"],
)

This release also adds the polygon, pie, and letterbox drawing primitives; diff for image-difference visualization (signed/abs/ssim modes); and blur/pixelate with optional masking for redaction.

Behavior changes

  • Shape primitives (circle_, ellipse_, rectangle_, star_, triangle_) now raise when called with neither fill nor outline, instead of silently returning the image unchanged (#123).
  • asrgb(rgba, copy=True) now returns an independent array for RGBA input; it previously returned a view, which could let in-place callers overwrite the source (#172).

New Features

  • flags2rgb composition (#170)
  • diff for image difference visualization with signed/abs/ssim modes (#144)
  • blur and pixelate (with optional mask for redaction) (#138)
  • letterbox primitive (#139)
  • pie drawing primitive (#146)
  • polygon drawing primitive (#121)
  • Directional multi-channel imgviz.pad (#167)

Bug fixes

  • label2rgb crash on all--1 input: no longer raises IndexError when the label contains only unlabeled (-1) pixels. (#122)
  • imread file-handle leak: the file handle is now closed after reading. (#124)
  • normalize min/max collapse after float32 cast: min and max are kept distinct after casting to float32. (#143)
  • Nchannel2Rgb cache comparison: avoids an ambiguous array comparison in the Nchannel2Rgb cache. (#169)
  • text_in_rectangle left alignment: lb/lb- text now aligns to the rectangle's left edge. (#175)
  • flow2rgb color-wheel overflow: prevents an out-of-bounds color-wheel index. (#173)

Internal

  • Extract corner legend into imgviz.components.legend (#168)
  • Publish to PyPI on GitHub release instead of tag push (#182)
  • Docs: rework diff example, record the visualization-construction architecture, dissolve ROADMAP.md into ADRs, and tidy README banners and image paths (#145, #147, #165, #177, #180)
  • Tests: expand coverage for instances2rgb, resize, and tile (#166, #171, #174)
  • Dependencies: add mdformat-gfm, bump urllib3 and idna, and align make targets (#140, #141, #120, #125)

Install

pip install -U imgviz==2.1.0
# or
uv pip install imgviz==2.1.0

Full changelog: v2.0.1...v2.1.0