# TensorFromImageOptions | ONNX Runtime JavaScript API
Documentation for ONNX Runtime JavaScript API

# Interface TensorFromImageOptions

Describes Tensor and Image configuration to an image data.

#### Hierarchy

- TensorFromImageOptions

- Defined in tensor.ts:273

#####
Index

### Properties

bitmapFormat?
dataType?
height?
norm?
resizedHeight?
resizedWidth?
tensorFormat?
tensorLayout?
width?

## Properties

### `Optional` bitmapFormat

bitmapFormat?: ImageFormat

Describes image data format - will be used only in the case of ImageBitMap

- Defined in tensor.ts:277

### `Optional` dataType

dataType?: "float32" | "uint8"

Tensor data type - default is 'float32'

- Defined in tensor.ts:285

### `Optional` height

height?: number

Describes Image Height - Required only in the case of ImageBitMap

- Defined in tensor.ts:293

### `Optional` norm

norm?: {
bias?: number;
mean?: number;
}

Describes normalization parameters to tensor conversion from image data - default values - Bias: 0, Mean: 255

#### Type declaration

- ##### `Optional` bias?: number

- ##### `Optional` mean?: number

- Defined in tensor.ts:309

### `Optional` resizedHeight

resizedHeight?: number

Describes resized height - can be accessed via tensor dimensions as well

- Defined in tensor.ts:301

### `Optional` resizedWidth

resizedWidth?: number

Describes resized width - can be accessed via tensor dimensions as well

- Defined in tensor.ts:305

### `Optional` tensorFormat

tensorFormat?: ImageFormat

Describes Tensor channels order - can differ from original image

- Defined in tensor.ts:281

### `Optional` tensorLayout

tensorLayout?: "NHWC" | "NCHW"

Tensor channel layout - default is 'NHWC'

- Defined in tensor.ts:289

### `Optional` width

width?: number

Describes Image Width - Required only in the case of ImageBitMap

- Defined in tensor.ts:297

Generated using TypeDoc