Skip to content

Main content

IIIF Canvas Coordinate Origin Shift Tool

Calculate iiif canvas coordinate origin shift from explicit caller-supplied inputs.

Loading tool…

Description

Map local image coordinates to a supplied canvas frame.

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.

Map local image coordinates to a supplied canvas frame.

When to use this tool

Use IIIF Canvas Coordinate Origin Shift when checking the stated image-region, scaling or media-range convention.

How to use the tool and how it works

  1. Enter x, y, originX, originY, scale. 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 canvasX, canvasY. Use the output convention below.

Map local image coordinates to a supplied canvas frame. Require positive scale; canvasX = originX+x*scale and canvasY similarly.1

Input fieldMeaning and unitsAccepted input
xXRequired. Finite number.
yYRequired. Finite number.
originXOrigin XRequired. Finite number.
originYOrigin YRequired. Finite number.
scaleSupplied scale multiplier; units must make the transformed coordinates compatible.Required. Finite number; strictly above 0.
Output fieldInterpretationReturned shape
canvasXCanvas XRequired. Finite number.
canvasYCanvas YRequired. Finite number.
json
{
  "input": {
    "x": 10,
    "y": 20,
    "originX": 100,
    "originY": 200,
    "scale": 0.5
  },
  "output": {
    "canvasX": 105,
    "canvasY": 210
  }
}

Limitations and assumptions

  • This applies translation and uniform scaling only; no manifest, rotation or canvas bounds are validated.
  • 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-canvas-coordinate-origin-shift — tool.io

Similar or alternative tools