---
id: fast-colors.loadimagedata
title: loadImageData() function
hide_title: true
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[@microsoft/fast-colors](./fast-colors.md) &gt; [loadImageData](./fast-colors.loadimagedata.md)

## loadImageData() function

Creates an HTMLImageElement and loads the source argument as its src. Then an HTMLCanvasElement is created and the image is copied into the canvas. The pixel data is then returned from the CanvasRenderingContext2D for that canvas.

<b>Signature:</b>

```typescript
export declare function loadImageData(source: string): Promise<ImageData>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  source | string |  |

<b>Returns:</b>

Promise&lt;ImageData&gt;
