Skip to content

Main content

IIIF Region Percent Pixel One Axis Tool

Outward-rounded pixel bounds for one in-bounds percentage crop axis, with an explicit floor-start/ceil-end convention.

Loading tool…

Description

Convert one percent region axis to outward-rounded pixel bounds.

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.

Convert one percent region axis to outward-rounded pixel bounds.

When to use this tool

Use IIIF Region Percent Pixel One Axis when checking the stated image-region, scaling or media-range convention.

How to use the tool and how it works

  1. Enter dimension, startPercent, extentPercent. 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 startPixel, endPixel, extentPixels. Use the output convention below.

Convert one percent region axis to outward-rounded pixel bounds. Require positive whole dimension, startPercent >= 0, extentPercent > 0 and their sum <= 100; floor the start, ceil the end and return their difference.1

Input fieldMeaning and unitsAccepted input
dimensionDimensionRequired. Safe integer; minimum 1.
startPercentStart Percent Unit: %.Required. Finite number; minimum 0.
extentPercentExtent Percent Unit: %.Required. Finite number; strictly above 0.
Output fieldInterpretationReturned shape
startPixelOutward-rounded lower pixel edge using floor.Required. Safe integer.
endPixelOutward-rounded upper pixel edge using ceil.Required. Safe integer.
extentPixelsExtent PixelsRequired. Safe integer.
json
{
  "input": {
    "dimension": 1000,
    "startPercent": 12.5,
    "extentPercent": 25
  },
  "output": {
    "startPixel": 125,
    "endPixel": 375,
    "extentPixels": 250
  }
}

Limitations and assumptions

  • This is one explicit rounding convention, not complete IIIF server behavior or a two-axis request.
  • 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-percent-pixel-one-axis — tool.io

Similar or alternative tools