Skip to content

Main content

IIIF Selector Reference Gap Tool

Compare explicit pixel-region selector anchors on a supplied IIIF source grid; no request parsing or image access.

Loading tool…

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

  1. Enter selectorX, selectorY, referenceX, referenceY, sourceWidth, sourceHeight. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. 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 fieldMeaning and unitsAccepted input
selectorXSelector XRequired. Finite number.
selectorYSelector YRequired. Finite number.
referenceXReference XRequired. Finite number.
referenceYReference YRequired. Finite number.
sourceWidthSource WidthRequired. Finite number; strictly above 0.
sourceHeightSource HeightRequired. Finite number; strictly above 0.
Output fieldInterpretationReturned shape
xFractionGapX Fraction GapRequired. Finite number.
yFractionGapY Fraction GapRequired. Finite number.
json
{
  "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

  1. Calculation and input contract: digital-humanities/iiif-selector-reference-gap — tool.io

Similar or alternative tools