---
title: Size
summary: The size of a region, specified as either absolute dimensions or a ratio. Exactly one of absolute or ratio must be provided.
url: https://www.fastly.com/documentation/reference/compute/sdks/javascript/js-compute/image-optimizer/interface.Size/
---

**Kind:** Interface  
**Module:** [image-optimizer](https://www.fastly.com/documentation/reference/compute/sdks/javascript/js-compute/image-optimizer/)  
**Package:** @fastly/js-compute 4.0.1  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/image-optimizer.d.ts#L26

The size of a region, specified as either absolute dimensions or a ratio.
Exactly one of `absolute` or `ratio` must be provided.

## Properties

### absolute

**Type:** `{ width: number | Percentage; height: number | Percentage }`  
**Flags:** optional  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/image-optimizer.d.ts#L30

Absolute dimensions, with width and height as integer pixel values or percentage strings.

### ratio

**Type:** `{ width: number; height: number }`  
**Flags:** optional  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/image-optimizer.d.ts#L37

Aspect ratio, with width and height as numbers.
