Skip to main content

fry-qt6-image-widget

fry-qt6-image-widget is a PyQt6 image viewing and annotation widget. The core class is FryCanvas, and it inherits from QtWidgets.QWidget, so it can be placed directly into a layout, a QMainWindow, a QScrollArea, or wrapped by the application as a QDockWidget when needed.

The package intentionally exposes a widget, not a dock. Dock behavior belongs to the host application.

Install

pip install fry-qt6-image-widget

For local development:

python -m pip install -e ".[dev]"
python -m pytest

Quick Start

import sys

import numpy as np
from PyQt6 import QtWidgets
from fry_qt6_image_widget import FryCanvas


app = QtWidgets.QApplication(sys.argv)

canvas = FryCanvas()
canvas.resize(900, 600)
canvas.setViewMode()

image = np.ones((480, 640, 3), dtype=np.uint8) * 255
canvas.show_image_np(image, description="white demo image")

canvas.show()
sys.exit(app.exec())

Common Imports

from fry_qt6_image_widget import (
    FryCanvas,
    FryCanvasMode,
    create_shape,
)

Backward-compatible imports are also available:

from fry_base_classes import FryCanvas

Typical Operations

canvas = FryCanvas()

canvas.show_image("demo.png")
canvas.show_image_np(image_np)
image_np = canvas.get_image_np()

canvas.set_canvas_mode("view")
canvas.set_canvas_mode("draw")
canvas.set_shape_type("rectangle")

shape = create_shape("rectangle", label="box")
canvas.append_shape(shape)
all_shapes = canvas.get_all_shapes_data()

Supported shape type strings include polygon, rectangle, circle, line, linestrip, point, points, mask, and brush.

Examples

Core Notes

The key concepts and integration notes are documented in docs/CORE_CONCEPTS.md.

Build a pip Package

python -m pip install build twine
python -m build
python -m twine check dist/*

This produces a source distribution and a wheel in dist/. To publish to PyPI, run:

python -m twine upload dist/*

Publishing needs a PyPI account and token, so the repository is prepared for upload but credentials are not stored in the project.

Release files for fry-qt6-image-widget 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fry-qt6-image-widget 0.2.1
File Size Uploaded
fry_qt6_image_widget-0.2.1.tar.gz 125.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fry-qt6-image-widget 0.2.1
File Interpreter ABI Platform
fry_qt6_image_widget-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 296.3 kB

Release files / fry_qt6_image_widget-0.2.1.tar.gz

Download URL fry_qt6_image_widget-0.2.1.tar.gz
Size 125.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b400b46b97df19205462f63e6f759ad371dcf3d1464471f2fc4351bd5914cd00
BLAKE2b-256 checksum
How to use checksums
001a325a504e0ab85bee478dff03891d3acf04f97b4277cd038b45fc25935712
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release files / fry_qt6_image_widget-0.2.1-py3-none-any.whl

Download URL fry_qt6_image_widget-0.2.1-py3-none-any.whl
Size 170.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f2430a3dbf216ff9c308a2ef21028852e711a8885278a2eb9e377dce65b8af04
BLAKE2b-256 checksum
How to use checksums
355733cbdd8a70c2d8d08249c090dd69321680787ce24f4579508a5f1e306a60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page