Skip to content

getDimensions

getDimensions(aspectRatio, quality): object

Defined in: dimensions.ts:26

Compute pixel dimensions from an aspect ratio and quality preset.

The quality value determines the shorter side in pixels:

  • '720p' → 720 px
  • '1080p' → 1080 px
  • '1440p' → 1440 px
  • '2160p' → 2160 px

The aspectRatio then sets the longer dimension. For landscape ratios (W > H) height equals the base; for portrait ratios (H > W) width equals the base. Dimension table:

Aspect Ratio720p1080p1440p2160p
16:91280×7201920×10802560×14403840×2160
9:16720×12801080×19201440×25602160×3840
1:1720×7201080×10801440×14402160×2160
4:3960×7201440×10801920×14402880×2160
3:4720×9601080×14401440×19202160×2880
5:4900×7201350×10801800×14402700×2160
4:5720×9001080×13501440×18002160×2700

AspectRatio

Quality

object

height: number

width: number