Description
Normalize an in-bounds rectangle to image fractions.
IIIF-related selectors describe image regions, canvas coordinates and media intervals. A local arithmetic helper can use a restricted syntax or rounding convention while a full IIIF request must satisfy the API and server behavior.
Normalize an in-bounds rectangle to image fractions.
When to use this tool
Use IIIF Region Normalized Offset when checking the stated image-region, scaling or media-range convention.
How to use the tool and how it works
- Enter x, y, width, height, imageWidth, imageHeight. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read xFraction, yFraction, widthFraction, heightFraction. Use the output convention below.
Normalize an in-bounds rectangle to image fractions. Require positive image dimensions and nonnegative x,y,width,height with rectangle contained; divide horizontal quantities by imageWidth and vertical quantities by imageHeight.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| x | X | Required. Finite number; minimum 0. |
| y | Y | Required. Finite number; minimum 0. |
| width | Extent on the stated coordinate or temporal basis. | Required. Finite number; minimum 0. |
| height | Height | Required. Finite number; minimum 0. |
| imageWidth | Image Width | Required. Finite number; strictly above 0. |
| imageHeight | Image Height | Required. Finite number; strictly above 0. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| xFraction | X Fraction | Required. Finite number. |
| yFraction | Y Fraction | Required. Finite number. |
| widthFraction | Width Fraction | Required. Finite number. |
| heightFraction | Height Fraction | Required. Finite number. |
{
"input": {
"x": 20,
"y": 10,
"width": 40,
"height": 30,
"imageWidth": 100,
"imageHeight": 50
},
"output": {
"xFraction": 0.2,
"yFraction": 0.2,
"widthFraction": 0.4,
"heightFraction": 0.6
}
} Limitations and assumptions
- Zero-sized rectangles are accepted arithmetic inputs, not certified valid IIIF requests.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Use a conforming IIIF client and actual manifest or image information for complete request validation and resource access.
References
Similar or alternative tools
- IIIF Region Percent Pixel One Axis
Convert one percent region axis to outward-rounded pixel bounds.
- IIIF Region Edge Precision Token
Round and clip a supplied region axis.