Description
Subtract left/right and top/bottom margins for croppedWidth and croppedHeight.
Layout calculations relate dimensions, offsets, and normalized positions in a drawing or display. A numeric coordinate depends on its origin and scale, while a size allowance must use the same length unit as the object.
Subtract left/right and top/bottom margins for croppedWidth and croppedHeight.
When to use this tool
Use Canvas Crop Margin Layout when you need a stated layout component from supplied dimensions or a normalized position.
How to use the tool and how it works
- Enter canvasWidth, canvasHeight, cropLeft, cropTop, cropRight, cropBottom. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read croppedWidth, croppedHeight. Use the output convention below.
Require nonnegative dimensions and crop margins whose opposing sums fit each canvas axis. Subtract left/right and top/bottom margins for croppedWidth and croppedHeight.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| canvasWidth | Canvas Width | Required. Finite number; minimum 0. |
| canvasHeight | Canvas Height | Required. Finite number; minimum 0. |
| cropLeft | Crop Left | Required. Finite number; minimum 0. |
| cropTop | Crop Top | Required. Finite number; minimum 0. |
| cropRight | Crop Right | Required. Finite number; minimum 0. |
| cropBottom | Crop Bottom | Required. Finite number; minimum 0. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| croppedWidth | Cropped Width | Required. Finite number. |
| croppedHeight | Cropped Height | Required. Finite number. |
{
"input": {
"canvasWidth": 100,
"canvasHeight": 80,
"cropLeft": 10,
"cropTop": 5,
"cropRight": 20,
"cropBottom": 15
},
"output": {
"croppedWidth": 70,
"croppedHeight": 60
}
} Limitations and assumptions
- Zero-sized crops are accepted; image resampling, bleed, print resolution, and actual content are not evaluated.
- 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
Check the assembled layout at its final scale and include installation or production allowances separately.
References
Similar or alternative tools
- Gallery Frame Gap
Subtract firstRightEdge from nextLeftEdge for signed gap and mark overlaps when the latter is smaller.
- Image Focal Point Normalized Coordinate
Require x and y within positive imageWidth and imageHeight and divide each coordinate by its corresponding dimension.