Description
Return normalized selector-reference coordinate gaps.
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.
Return normalized selector-reference coordinate gaps.
When to use this tool
Use IIIF Selector Reference Gap when checking the stated image-region, scaling or media-range convention.
How to use the tool and how it works
- Enter selectorX, selectorY, referenceX, referenceY, sourceWidth, sourceHeight. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read xFractionGap, yFractionGap. Use the output convention below.
Return normalized selector-reference coordinate gaps. Require positive sourceWidth/sourceHeight; divide selectorX-referenceX by width and the y difference by height.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| selectorX | Selector X | Required. Finite number. |
| selectorY | Selector Y | Required. Finite number. |
| referenceX | Reference X | Required. Finite number. |
| referenceY | Reference Y | Required. Finite number. |
| sourceWidth | Source Width | Required. Finite number; strictly above 0. |
| sourceHeight | Source Height | Required. Finite number; strictly above 0. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| xFractionGap | X Fraction Gap | Required. Finite number. |
| yFractionGap | Y Fraction Gap | Required. Finite number. |
{
"input": {
"selectorX": 20,
"selectorY": 30,
"referenceX": 10,
"referenceY": 10,
"sourceWidth": 100,
"sourceHeight": 200
},
"output": {
"xFractionGap": 0.1,
"yFractionGap": 0.1
}
} Limitations and assumptions
- No bounds, image retrieval or selector validity are established; inputs may describe out-of-image locations.
- 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.
- Digital Humanities: IIIF Xywh Region Token
Parse a restricted IIIF-style xywh token.