# Interface: ElementImageSourceOptions

**`Experimental`** **`Advanced`**

Options for creating an [ElementImageSource](rendering.ElementImageSource.html.md).

## Example

```ts
import { ElementImageSource } from 'pixi.js/html-source';

// Manual lifetime (default): you call snapshot.close() yourself.
const source = new ElementImageSource({ resource: snapshot });

// Let the source close the snapshot for you when it is destroyed.
const owned = new ElementImageSource({ resource: snapshot, autoClose: true });
```

## See

[ElementImageSource](rendering.ElementImageSource.html.md) For the texture source these options configure

## Extends

- [`TextureSourceOptions`](rendering.TextureSourceOptions.html.md)\<[`ElementImage`](rendering.ElementImage.html.md)\>

## Properties

### autoClose?

> `optional` **autoClose**: `boolean`

**`Experimental`**

Call [ElementImage.close](rendering.ElementImage.html#close) on the snapshot when this source is destroyed. Leave
`false` when the same snapshot is shared with other sources or reused later, otherwise
you risk a use-after-free.

#### Default

```ts
false
```

#### Example

```ts
const source = new ElementImageSource({ resource: snapshot, autoClose: true });

source.destroy(); // snapshot.close() is called for you
```
