# writeImage

Function

Source: https://github.com/playcanvas/splat-transform/blob/b6424a5b3b929695fbaafe738a995adb1240d675/src/lib/writers/write-image.ts#L214

```ts
writeImage(options: WriteImageOptions, fs: FileSystem): Promise<void>
```

Renders the splat scene to a lossless WebP image written via `fs`, or to
a sequence of them along a camera track.

**Parameters**

- `options` ([`WriteImageOptions`](https://api.playcanvas.com/splat-transform/types/WriteImageOptions.md)): Render parameters and target filename.
- `fs` (`FileSystem`): File system abstraction for writing the output.

**Returns** `Promise<void>`

**Example**

```ts
await writeImage({
    filename: 'view.webp',
    source,
    pool,
    cameraPosition: { x: 0, y: 0, z: 5 },
    fov: 60,
    width: 1920, height: 1080,
    createDevice: async () => myDevice
}, fs);
```
