---
title: "ImageData | JavaScript maps SDK"
description: "Documentation for MapTiler SDK"
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# Interface ImageData

The **`ImageData`** interface represents the underlying pixel data of an area of a

element.

[MDN Reference](https://developer.mozilla.org/docs/Web/API/ImageData)

interface ImageData {  
    [colorSpace](#colorspace): [PredefinedColorSpace](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.PredefinedColorSpace/);  
    [data](#data): [ImageDataArray](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.ImageDataArray/);  
    [height](#height): number;  
    [width](#width): number;  
}

##### Index

### Properties[](#properties)

[colorSpace](#colorspace) [data](#data) [height](#height) [width](#width)

## Properties[](#properties-1)

### `Readonly`colorSpace[](#colorspace)

colorSpace: [PredefinedColorSpace](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.PredefinedColorSpace/)

The read-only **`ImageData.colorSpace`** property is a string indicating the color space of the image data.

[MDN Reference](https://developer.mozilla.org/docs/Web/API/ImageData/colorSpace)

### `Readonly`data[](#data)

data: [ImageDataArray](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.ImageDataArray/)

The readonly **`ImageData.data`** property returns a Uint8ClampedArray or Float16Array that contains the ImageData object's pixel data. Data is stored as a one-dimensional array in the RGBA order.

[MDN Reference](https://developer.mozilla.org/docs/Web/API/ImageData/data)

### `Readonly`height[](#height)

height: number

The readonly **`ImageData.height`** property returns the number of rows in the ImageData object.

[MDN Reference](https://developer.mozilla.org/docs/Web/API/ImageData/height)

### `Readonly`width[](#width)

width: number

The readonly **`ImageData.width`** property returns the number of pixels per row in the ImageData object.

[MDN Reference](https://developer.mozilla.org/docs/Web/API/ImageData/width)
