# Generating Images

You can generate PNG images for charts, custom drawings, or any other visual content created with the Kendo UI Drawing library.

To generate an image on the client, use the [`exportImage`](https://www.telerik.com/kendo-angular-ui-develop/components/drawing/api/exportimage) function provided by the Kendo UI Drawing library.

The function takes the root [`Group`](https://www.telerik.com/kendo-angular-ui-develop/components/drawing/api/group) of your scene, positioned at `[0, 0]` in the output. It returns a promise that resolves with a `data:image/png` [Data URI](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs). Assign the URI to an `<img>` element, save it to disk with a utility such as `saveAs` from `@progress/kendo-file-saver`, or upload it.

```javascript
import { exportImage, Group } from "@progress/kendo-drawing";
import { saveAs } from "@progress/kendo-file-saver";

const scene = new Group();
// ... populate the scene ...

exportImage(scene).then((dataUri) => {
    const img = document.createElement("img");
    img.src = dataUri;
    document.body.appendChild(img);
    saveAs(dataUri, "scene.png");
});
```

For more control over the exported image, like specifying the dimensions or handling cross-origin images, you can pass an [`ImageExportOptions`](https://www.telerik.com/kendo-angular-ui-develop/components/drawing/api/imageexportoptions) object to the `exportImage` function.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/drawing/exporting-drawings-to-images/source.txt)

## Suggested Links

* [PDF Output](https://www.telerik.com/kendo-angular-ui-develop/components/drawing/pdf-output)
* [Exporting Drawings to SVG](https://www.telerik.com/kendo-angular-ui-develop/components/drawing/export-svg)
* [API Reference of the Drawing Library](https://www.telerik.com/kendo-angular-ui-develop/components/drawing/api)
* [Image Export Options by the Drawing Library](https://www.telerik.com/kendo-angular-ui-develop/components/drawing/api/imageexportoptions)
* [PDF Options by the Drawing Library](https://www.telerik.com/kendo-angular-ui-develop/components/drawing/api/pdf/pdfoptions)
* [API Reference of the PDF Export Component](https://www.telerik.com/kendo-angular-ui-develop/components/pdf-export/api/pdfexportcomponent)
