Skip to content

Main content

Icon Stroke Pixel Ratio

Normalize a supplied icon stroke width to its positive display width.

Loading tool…

Description

Express icon stroke width as a fraction of supplied icon width in pixels.

Print and screen geometry depends on coordinate scale, placed image size, bleed/inset definitions and pixel transparency. Placed pixels per inch differs from printer dots per inch, and a caller-chosen margin differs from a verified production tolerance. Empty-image conventions and threshold equality affect bounding results.

Express icon stroke width as a fraction of supplied icon width in pixels.

When to use this tool

Use Icon Stroke Pixel Ratio when checking the stated artwork geometry, placement, screen angle or alpha-bound convention.

How to use the tool and how it works

  1. Enter strokeWidthPixels, iconWidthPixels. 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 relativeStrokeWidth. Use the output convention below.

Require strokeWidthPixels>=0 and iconWidthPixels>0. Return stroke/icon width as a dimensionless ratio.1

Input fieldMeaning and unitsAccepted input
strokeWidthPixelsStroke Width PixelsRequired. Finite number; minimum 0.
iconWidthPixelsIcon Width PixelsRequired. Finite number; strictly above 0.
Output fieldInterpretationReturned shape
relativeStrokeWidthRelative Stroke WidthRequired. Finite number.
json
{
  "input": {
    "strokeWidthPixels": 2,
    "iconWidthPixels": 24
  },
  "output": {
    "relativeStrokeWidth": 0.08333333333333333
  }
}

Limitations and assumptions

  • Both use the same pixel-coordinate scale; no rendering, optical balance or platform icon guideline is checked.
  • 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

Inspect rendered artwork and verified production/device specifications for actual print quality, cropping, fit and manufacturing requirements.

References

  1. Calculation and input contract: graphic-design/icon-stroke-pixel-ratio — tool.io

Similar or alternative tools