Skip to content

Main content

IIIF Region Normalized Offset Tool

Normalize an already resolved image-region rectangle to unit fractions; not an IIIF pct URL formatter or image fetcher.

Loading tool…

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

  1. Enter x, y, width, height, imageWidth, imageHeight. 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 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 fieldMeaning and unitsAccepted input
xXRequired. Finite number; minimum 0.
yYRequired. Finite number; minimum 0.
widthExtent on the stated coordinate or temporal basis.Required. Finite number; minimum 0.
heightHeightRequired. Finite number; minimum 0.
imageWidthImage WidthRequired. Finite number; strictly above 0.
imageHeightImage HeightRequired. Finite number; strictly above 0.
Output fieldInterpretationReturned shape
xFractionX FractionRequired. Finite number.
yFractionY FractionRequired. Finite number.
widthFractionWidth FractionRequired. Finite number.
heightFractionHeight FractionRequired. Finite number.
json
{
  "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

  1. Calculation and input contract: digital-humanities/iiif-region-normalized-offset — tool.io

Similar or alternative tools