> ## Documentation Index
> Fetch the complete documentation index at: https://docs.embededitor.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Filter, Frame and Adjustments

> Choose a filter and a frame, set the adjustments, turn Auto on and choose the palette from code, as the strips, the rulers, Auto's ring and the palette menu do.

`filter`, `frame`, `adjust` and `auto` change how the photo looks, and `palette` the colors every color row offers. Each command does what the same strip, ruler, ring or menu does on screen, with its undo step, and follows [the rules of every command](https://docs.embededitor.com/api-reference/commands/overview.md#how-every-command-behaves).

The examples call the handle `editor`. See [Get the handle](https://docs.embededitor.com/api-reference/commands/overview.md#get-the-handle).

> [!NOTE]
>
> Full and Trial only. In the Free and the Lite the five groups exist and every command rejects with `NOT_AVAILABLE`.

Values are the ones [EditState](https://docs.embededitor.com/api-reference/state.md) writes: a filter's `id` and its `intensity` 0 to 100, a frame's `style` and its `color`, each adjustment by its key at −100 to 100 (`sharpness` 0 to 100), and Auto's `amount` at −100 to 100.

Every command here but `palette.set` is one undo step, and none when the photo already looks that way. A command doesn't show the item it changes, though the filter's or the frame's name shows over the photo as it changes, as it does for an undo.

## Filter

```ts theme={"dark"}
filter: {
	clear: () => Promise<null>;
	set: (input: {
		id: 'DRAMATIC' | 'DRAMATIC_COOL' | 'DRAMATIC_WARM' | 'MONO' | 'NOIR' | 'SILVERTONE' | 'VIVID' | 'VIVID_COOL' | 'VIVID_WARM';
		intensity?: number;
	}) => Promise<null>;
};
```

Filter is off when you set `enableFilter: false`, and then both commands reject with `NOT_AVAILABLE`.

### set()

Chooses a filter, as a tap on it in Filter's strip.

**id** `string` *required*

`'VIVID'`, `'VIVID_WARM'`, `'VIVID_COOL'`, `'DRAMATIC'`, `'DRAMATIC_WARM'`, `'DRAMATIC_COOL'`, `'MONO'`, `'SILVERTONE'` or `'NOIR'`.

**intensity** `number`

0 to 100, as the filter's ruler. Left out, another filter comes in at full strength, as a tap brings it, and the filter already chosen keeps its intensity.

### clear()

Takes the filter away, as Original in the strip.

```ts filter.ts theme={"dark"}
await editor.filter.set({ id: 'MONO' }); // at full strength
await editor.filter.set({ id: 'MONO', intensity: 60 }); // the same filter, its intensity
await editor.filter.clear();
```

## Frame

```ts theme={"dark"}
frame: {
	clear: () => Promise<null>;
	set: (input: {
		color?: string;
		style:
			| 'CORNER_HOOKS'
			| 'EDGE_CROSS'
			| 'EDGE_OVERLAP'
			| 'EDGE_SEPARATE'
			| 'FILM'
			| 'GALLERY'
			| 'LINE_MULTIPLE'
			| 'LINE_SINGLE'
			| 'MAT_ROUND'
			| 'MAT_SHARP'
			| 'PHOTO_CORNERS'
			| 'POLAROID'
			| 'ROUND_CORNERS';
	}) => Promise<null>;
};
```

Frame is off when you set `enableFrame: false`, and then both commands reject with `NOT_AVAILABLE`.

### set()

Chooses a frame and its color, as a tap on its tile in Frame's strip and one on a color of its row. Both land as one undo step.

**style** `string` *required*

`'MAT_SHARP'`, `'MAT_ROUND'`, `'LINE_SINGLE'`, `'LINE_MULTIPLE'`, `'EDGE_CROSS'`, `'EDGE_SEPARATE'`, `'EDGE_OVERLAP'`, `'CORNER_HOOKS'`, `'POLAROID'`, `'FILM'`, `'ROUND_CORNERS'`, `'GALLERY'` or `'PHOTO_CORNERS'`.

**color** `string`

`#rrggbb` or `#rgb`, in any case. The state writes it as six lowercase digits. Left out, the frame keeps the color it has, white at first, as a tap on a tile does.

### clear()

Takes the frame away, as None in the strip. Its color stays for the next frame.

```ts frame.ts theme={"dark"}
await editor.frame.set({ color: '#1a1a1a', style: 'POLAROID' });
await editor.frame.set({ style: 'FILM' }); // the color kept
await editor.frame.clear();
```

## Adjustments

```ts theme={"dark"}
adjust: {
	reset: (input: { key: keyof NonNullable<EditState['adjustments']> }) => Promise<null>;
	set: (input: { key: keyof NonNullable<EditState['adjustments']>; value: number }) => Promise<null>;
};
```

An adjustment goes by its key in the state's `adjustments`: `'exposure'`, `'brilliance'`, `'highlights'`, `'shadows'`, `'contrast'`, `'brightness'`, `'blackPoint'`, `'saturation'`, `'vibrance'`, `'warmth'`, `'sharpness'` and `'vignette'`.

The adjustments are off when you set `enableFinetune: false`, and then both commands reject with `NOT_AVAILABLE`.

### set()

Sets an adjustment, as its ruler.

**key** `string` *required*

The adjustment's key.

**value** `number` *required*

−100 to 100, `0` the photo as it is. `'sharpness'` only goes up, 0 to 100. When Auto is on, the adjustments draw on top of it.

### reset()

Sets an adjustment back to `0`.

```ts adjustments.ts theme={"dark"}
await editor.adjust.set({ key: 'exposure', value: 20 });
await editor.adjust.set({ key: 'sharpness', value: 35 });
await editor.adjust.reset({ key: 'exposure' });
```

## Auto

```ts theme={"dark"}
auto: {
	off: () => Promise<null>;
	on: () => Promise<null>;
	setAmount: (input: { value: number }) => Promise<null>;
};
```

Auto is off with the adjustments, when you set `enableFinetune: false`, and then every command here rejects with `NOT_AVAILABLE`.

### on()

Turns Auto on, as a tap on its ring or on Auto Enhance. It comes back at the amount a tap turned it off at, or at the photo's own amount (the state's `auto.origin`).

Auto needs the photo read first. The editor reads it while it is idle, so it is usually ready. If not, `on()` waits for it. When the photo can't be read, or the reading takes too long, it rejects with `NOT_AVAILABLE` and nothing changes.

### off()

Turns Auto off, as a tap on its ring. Its amount is kept for the next `on()`.

### setAmount()

Sets how much Auto does, as its ruler: −100 to 100, the state's `auto.amount`. While Auto is off it rejects with `NOT_AVAILABLE`: call `on()` first.

```ts auto.ts theme={"dark"}
await editor.auto.on(); // waits for the photo's reading
await editor.auto.setAmount({ value: 40 });
await editor.auto.off();
```

## Palette

```ts theme={"dark"}
palette: {
	set: (input: { palette: 'EARTH' | 'PASTEL' | 'PHOTO' | 'PHOTO_PASTEL' | 'PHOTO_VIVID' | 'VIBRANT' }) => Promise<null>;
};
```

### set()

Chooses the set of colors every color row shows, as the palette menu that heads each one: Annotate's, the frame's, a mark's and a solid area's. The editor's own sets are `'VIBRANT'`, `'PASTEL'` and `'EARTH'`; the photo's are `'PHOTO'`, `'PHOTO_PASTEL'` and `'PHOTO_VIVID'`. A photo set chosen before its colors are read off the photo fills in once they are, as on screen. The set is kept while the editor is open and never saved, so there is no undo step. No host prop turns it off.

```ts palette.ts theme={"dark"}
await editor.palette.set({ palette: 'PASTEL' }); // every color row, at once
```

## Errors

| `code` | When |
| - | - |
| `NOT_AVAILABLE` | The item is off (`enableFilter`, `enableFrame` or `enableFinetune`), Auto is off for `auto.setAmount`, or the photo can't be read in time for `auto.on`. Also always in the Free and the Lite. |
| `INVALID_COMMAND` | An input off its schema, `props` naming each path (`input.value`): an unknown id, style or key, a value off its range, a color that isn't a hex. |

A rejected command changes nothing.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.