Reference Image Pixel Regions
Convert normalized annotations into the smallest integer pixel rectangle that fully contains the selection. This is useful when an annotation arrives as fractions of the image width and height and a cropper expects pixel coordinates.
Usage
pip install reference-image-pixel-regions
from reference_image_pixel_regions import enclosing_pixels
region = enclosing_pixels(1200, 800, "0.25", "0.10", "0.75", "0.50")
# PixelRegion(left=300, top=80, right=900, bottom=400)
The origin is the top left. Right and bottom are exclusive. Supply coordinates in the range 0 to 1. Decimal strings preserve the intended boundary. The library works with dimensions and coordinates and leaves image I/O and editing to the caller. It requires Python 3.9 or newer and uses the standard library.
For the related online editing workflow, see the AI H3 Image reference-image workspace.
MIT license.
Metadata
Release files for reference-image-pixel-regions 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| reference_image_pixel_regions-0.1.0.tar.gz | 3.0 kB | Without provenance | Details for reference_image_pixel_regions-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| reference_image_pixel_regions-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for reference_image_pixel_regions-0.1.0-py3-none-any.whl |
Total release size: 6.6 kB
Release files / reference_image_pixel_regions-0.1.0.tar.gz
| Download URL | reference_image_pixel_regions-0.1.0.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e2efd7da8d14d1296c977596360b8879a264ee1fbad5a9feef3037b88109a8e3
|
|
BLAKE2b-256 checksum How to use checksums |
7280c78697ea9457efd758957db9eb803bc8997f07d4fbf67aedfcf7a517689f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.13
|
Release files / reference_image_pixel_regions-0.1.0-py3-none-any.whl
| Download URL | reference_image_pixel_regions-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4baac4bf130e2a12cc8a92399f7c004399b08576c68227e2b06b30de30175707
|
|
BLAKE2b-256 checksum How to use checksums |
5fced42893b2927654253d4573e6eae62bb96b0476ef7b145c478ec3273ad084
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.13
|
Security for reference-image-pixel-regions 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.