{Math.round(editor.state.zoom * 100)}%
{#if transformActive} {:else if transformError} {/if}
rootEl} open={openPanel} class="flex-1 h-[360px] md:h-full min-h-[320px] bg-muted" />
{#if activeTab === 'crop'}
Aspect Ratio Presets
Orientation & Flips
{/if} {#if activeTab === 'adjust'}
Color Adjustments
{#each IMAGE_ADJUSTMENT_CONTROLS as spec (spec.id)} editor.setAdjustments({ [spec.id]: v })} /> {#if spec.id === 'tint' && legacyProcess}
Legacy rendering (process 1). Tint needs the current process.
{/if} {/each}
{/if} {#if activeTab === 'layers'}
Layers {#if effectsShown}{/if} Colour
{/if} {#if activeTab === 'paint'}
Paint {#if paintError} {/if}
{/if} {#if activeTab === 'annotate'}
Shape & Type Layers, Paths
{#each ['shape', 'type', 'path-pen', 'path-select', 'direct-select'] as const as t (t)} {/each}
{#if editor.state.activeTool === 'shape'} (shapeOptions = o)} /> {/if} {#if editor.state.activeTool === 'type'} (typeOptions = o)} session={typeSession} /> {#if typeSession} {/if} {/if} {#if shapeTypeError} {/if}
Draw & Annotate
{#each (['pen', 'rect', 'circle', 'arrow', 'line'] as ImageEditorTool[]) as t} {/each}
Color: (activeColor = c)} />
Width: {strokeWidth}px
Add Text
e.key === 'Enter' && handleAddText()} class="flex-1 bg-background border border-border rounded-lg px-2.5 py-1.5 text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:border-primary" />
Font Size: {fontSize}px
Layers ({editor.state.annotations.length}) {#if editor.state.selectedAnnotationId} {/if} {#if editor.state.annotations.length > 0} {/if}
{/if} {#if activeTab === 'depth'}
Depth Masking
{#if editor.state.depthMask.enabled}
Mask Image URL: editor.setDepthMask({ maskSource: (e.target as HTMLInputElement).value || null })} class="w-full bg-background border border-border rounded-lg px-2.5 py-1.5 text-xs text-foreground placeholder:text-muted-foreground" />
Depth Start (Lower): {editor.state.depthMask.depthRange[0]}
editor.setDepthMask({ depthRange: [Number((e.target as HTMLInputElement).value), editor.state.depthMask.depthRange[1]], })} class={imageRangeClass} />
Depth Stop (Upper): {editor.state.depthMask.depthRange[1]}
editor.setDepthMask({ depthRange: [editor.state.depthMask.depthRange[0], Number((e.target as HTMLInputElement).value)], })} class={imageRangeClass} />
Softness: {editor.state.depthMask.softness}
editor.setDepthMask({ softness: Number((e.target as HTMLInputElement).value) })} class={imageRangeClass} />
{/if}
{/if} {#if activeTab === 'select'}
(selectionOptions = next)} selection={editor.state.selection ?? null} quickMask={Boolean(editor.state.quickMask)} selectionDisplay={editor.state.selectionDisplay} /> {#if selectionError} {/if}
{/if} {#if activeTab === 'ai'}
Background Removal {#if isRemovingBg} Removing... {/if}

Isolate foreground subject with AI alpha transparency segmentation.

Generative Inpainting {#if isInpainting} Inpainting... {/if}

Replace, modify, or fill selected regions using prompt-guided generative inpainting.

Target Mask Region
{#if aiError}
{aiError}
{/if} {#if aiSuccess}
{aiSuccess}
{/if}
{/if}