supervision/docs/utils
Jirka Borovec 16814acff3
feat(utils): add `TkImageWindow` to unblock switch to `opencv-python-headless` (#2320)
- Added `sv.ImageWindow`, a Tkinter/Pillow-based desktop image viewer with BGR, grayscale, and BGRA support, keyboard polling, left-click callbacks, context-manager usage, window-state checks, and clean close handling
- Added responsive image resizing with optional aspect-ratio preservation and correctly mapped mouse coordinates after scaling or letterboxing
- Updated compatible runnable examples to use `sv.ImageWindow`, while retaining OpenCV display APIs for worker-thread streaming examples that are incompatible with Tkinter
- Improved `sv.cv2_to_pillow` to support grayscale and BGRA images
- Updated webcam guidance to clarify capture ownership and explicit `VideoCapture` cleanup
- Fixed image-window event handling to prevent stale keypresses, ghost windows, close-time races, and blocked waits after the window closes

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-07-15 15:06:55 +02:00
..
conversion.md fix(docs): resolve review deprecation follow-ups (#2415) 2026-07-08 14:30:32 +02:00
draw.md Add draw_filled_polygon to docs, fix a few docstring types 2024-09-19 22:37:36 +03:00
file.md Add "new" tags 2024-08-27 17:18:44 +03:00
geometry.md fix(docs): resolve review deprecation follow-ups (#2415) 2026-07-08 14:30:32 +02:00
image.md reimplement `crop_image` to skip type casting when Pillow Image given 2025-11-14 17:55:07 +01:00
image_window.md feat(utils): add `TkImageWindow` to unblock switch to `opencv-python-headless` (#2320) 2026-07-15 15:06:55 +02:00
iterables.md Update "New" tags in docs, fix typo in one heading 2024-06-05 17:44:25 +02:00
notebook.md improved docs linking 2024-04-24 16:28:48 +02:00
video.md Update "New" tags in documentation 2024-10-04 22:22:10 +03:00