# Interface ImageOptions

图片参数

interface ImageOptions {
cut?: [x: number, y: number, width: number, height: number];
forceUseExifOrientation?: boolean;
format?: "webp" | "avif" | "heif" | "jpg" | "jpeg" | "png" | "heic";
mappings?: ImageURLMappings;
quality?: number;
sharpen?: number;
size?: number;
transform?: (url: string, options: ImageURLOptions) => string;
}

#### Hierarchy (View Summary)

- Omit<ImageURLOptions, "key">
  - ImageOptions
    - TextureOptions

- Defined in lib/five/types/imageOptions.ts:6

##### Index

### Properties

cut?
forceUseExifOrientation?
format?
mappings?
quality?
sharpen?
size?
transform?

## Properties

### `Optional` cut

cut?: [x: number, y: number, width: number, height: number]

图片裁切

Inherited from ImageURLOptions.cut

- Defined in lib/five/utils/imageURL.ts:40

### `Optional` forceUseExifOrientation

forceUseExifOrientation?: boolean

腾讯云在做裁切, 旋转等操作时，需要此参数，应用 exif orientation

Inherited from ImageURLOptions.forceUseExifOrientation

- Defined in lib/five/utils/imageURL.ts:46

### `Optional` format

format?: "webp" | "avif" | "heif" | "jpg" | "jpeg" | "png" | "heic"

图片格式参数

Inherited from ImageURLOptions.format

- Defined in lib/five/utils/imageURL.ts:37

### `Optional` mappings

mappings?: ImageURLMappings

域名匹配规则

Inherited from ImageURLOptions.mappings

- Defined in lib/five/utils/imageURL.ts:49

### `Optional` quality

quality?: number

图片质量参数(0-100)

Inherited from ImageURLOptions.quality

- Defined in lib/five/utils/imageURL.ts:34

### `Optional` sharpen

sharpen?: number

锐化参数 海外不支持

Inherited from ImageURLOptions.sharpen

- Defined in lib/five/utils/imageURL.ts:43

### `Optional` size

size?: number

图片尺寸参数 尽量使用 2 的幂次 如 256 512 1024

Inherited from ImageURLOptions.size

- Defined in lib/five/utils/imageURL.ts:31

### `Optional` transform

transform?: (url: string, options: ImageURLOptions) => string

url 地址转化

#### Type Declaration

- - (url: string, options: ImageURLOptions): string

  - #### Parameters

    - url: string

      原始地址

    - options: ImageURLOptions

      当前地址参数

    #### Returns string

    转化后地址

- Defined in lib/five/types/imageOptions.ts:13