Aspect Calc
/install aspect-calc
Aspect Ratio Calculator
Calculate simplified aspect ratios from pixel dimensions, find missing dimensions from a known ratio, and report decimal and percentage equivalents using GCD simplification.
Input
- Two dimensions (width and height in pixels), OR
- A known ratio (e.g.,
16:9) and one dimension (width or height), to calculate the missing value
Output
- Simplified ratio (e.g.,
16:9) - Decimal ratio (e.g.,
1.7778) - Percentage (width as % of height, e.g.,
177.78%) - If solving for missing dimension: the calculated value
Instructions
- Parse the user's input to determine the mode:
- Mode A: two pixel dimensions given → calculate ratio and metadata
- Mode B: ratio + one dimension given → calculate the missing dimension
- Mode A — Ratio from dimensions:
a. Compute
divisor = GCD(width, height)using the Euclidean algorithm:GCD(a, b) = b === 0 ? a : GCD(b, a % b)b. Simplified ratio:(width / divisor):(height / divisor)c. Decimal:(width / height).toFixed(4)d. Percentage:(width / height * 100).toFixed(2)% - Mode B — Dimension from ratio:
a. Parse the ratio as
rW:rHb. If width is given:height = round(width * rH / rW)c. If height is given:width = round(height * rW / rH) - Identify if the ratio matches a known standard and name it:
16:9→ HD Video / Widescreen4:3→ Classic TV / Standard1:1→ Square21:9→ Ultrawide9:16→ Mobile Video / Story3:4→ Portrait Classic3:2→ 35mm Film2:3→ Portrait Photo
- Output all results clearly.
Options
width: positive integerheight: positive integerratio: string inW:Hformat — for Mode Blocked: if true, preserve the current ratio when one dimension changes
Examples
Input: "What is the aspect ratio of 1920x1080?" Output:
- Simplified ratio: 16:9 (HD Video / Widescreen)
- Decimal: 1.7778
- Percentage: 177.78% (width is 177.78% of height)
Input: "I have a 16:9 video, width is 1280px — what height do I need?" Output:
- Width: 1280px, Ratio: 16:9
- Height: 720px
- (1280 × 9 / 16 = 720)
Input: "Simplify 2560x1440" Output:
- Simplified ratio: 16:9 (HD Video / Widescreen)
- Decimal: 1.7778
- Percentage: 177.78%
Input: "What is the aspect ratio of 800x600?" Output:
- Simplified ratio: 4:3 (Classic TV / Standard)
- Decimal: 1.3333
- Percentage: 133.33%
Input: "Give me height for a 21:9 ultrawide at 2560px width" Output:
- Width: 2560px, Ratio: 21:9
- Height: 1097px
- (2560 × 9 / 21 ≈ 1097)
Error Handling
- If either dimension is 0 or negative, return an error: "Dimensions must be positive integers greater than 0."
- If a ratio is provided in an invalid format (not
W:H), ask the user to use theW:Hformat (e.g.,16:9). - If both dimensions result in the same ratio numerator and denominator equal to 1 (e.g., prime dimensions with no common factor), output the ratio as-is and note it cannot be simplified further.
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install aspect-calc - After installation, invoke the skill by name or use
/aspect-calc - Provide required inputs per the skill's parameter spec and get structured output
What is Aspect Calc?
Calculate aspect ratios from dimensions and find missing width or height. Use when the user asks to calculate an aspect ratio, find the height for a given wi... It is an AI Agent Skill for Claude Code / OpenClaw, with 136 downloads so far.
How do I install Aspect Calc?
Run "/install aspect-calc" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Aspect Calc free?
Yes, Aspect Calc is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Aspect Calc support?
Aspect Calc is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Aspect Calc?
It is built and maintained by Omar Hernandez (@ohernandez-dev-blossom); the current version is v1.0.0.