Skip to content

Main content

IIIF Region Area Share Tool

Compute a supplied pixel region’s unit-fraction area within an image; no IIIF request is generated.

Loading tool…

Description

Return an in-image rectangle's area fraction.

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 an in-image rectangle's area fraction.

When to use this tool

Use IIIF Region Area Share when checking the stated image-region, scaling or media-range convention.

How to use the tool and how it works

  1. Enter x, y, regionWidth, regionHeight, 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 share. Use the output convention below.

Return an in-image rectangle's area fraction. Require positive image dimensions and a contained nonnegative rectangle; share = (regionWidth/imageWidth)*(regionHeight/imageHeight).1

Input fieldMeaning and unitsAccepted input
xXRequired. Finite number; minimum 0.
yYRequired. Finite number; minimum 0.
regionWidthRegion WidthRequired. Finite number; minimum 0.
regionHeightRegion HeightRequired. Finite number; minimum 0.
imageWidthImage WidthRequired. Finite number; strictly above 0.
imageHeightImage HeightRequired. Finite number; strictly above 0.
Output fieldInterpretationReturned shape
shareDimensionless ratio on the explicitly stated numerator and denominator basis.Required. Finite number.
json
{
  "input": {
    "x": 10,
    "y": 20,
    "regionWidth": 40,
    "regionHeight": 20,
    "imageWidth": 100,
    "imageHeight": 100
  },
  "output": {
    "share": 0.08000000000000002
  }
}

Limitations and assumptions

  • This is geometric area support, not visual importance, OCR coverage or image quality.
  • 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-area-share — tool.io

Similar or alternative tools