# API for creating and modifying image data.

## Content

<span style="color: rgb(23, 43, 77); font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">DsImageViewer allows you to create new or modify existing images using the following client API:</span>

```
// Create empty image.
async newImage(options?: { width?: number; height?: number }) 

// Get unmodified image data url.
public getOriginalImageDataUrl(): string

// Get current image data url.
public getImageDataUrl(): string

// Modify current image data url.
public setImageDataUrl(dataUrl): Promise<void>

// Download the Image document loaded in the Viewer to the local disk.
public download(fileName?: string, getInitialVersion?: boolean) 
```

<span style="color: rgb(58, 70, 82); font-family: Montserrat, Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 300; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">These examples show how to use the client API to create or modify images:</span>

* [Create new image](modify-image-data/paint-new-image)
* [Draw on an existing image](modify-image-data/modify-image)

### Limitations

* Modification of vector or multi-frame images (SVG, GIF, ICO, TIFF) is not supported.
* Only static images can be modified.