Skip to main content
Version: Latest

Image Editor

Paid Feature

This feature is only available in paid plans. Learn More

We have a built-in image editor that can be used to resize, crop or apply effects to images. It's enabled by default but you can disable it if you want. You can also access it by double-clicking on any image.

unlayer.init({
features: {
imageEditor: {
enabled: false,
},
},
});

Image Editor Tools

You can also choose to disable any of the image editor tools. By default, all of these tools are enabled: Filter, Resize, Crop, Draw, Text, Shapes, Stickers, Frame, Corners and Merge.

Here's an example if you want to disable the Resize tool in the image editor.

unlayer.init({
features: {
imageEditor: {
tools: {
resize: false,
},
},
},
});

Customize Tool Icons

Each tool entry also accepts an object form so you can customize its icon while keeping the tool enabled. The icon field accepts a FontAwesome icon name (with or without the fa- prefix), an image URL (http(s):, data:, or absolute path), or inline SVG markup (must start with <svg). The object form also accepts enabled so you can mix-and-match tool visibility with icon overrides.

unlayer.init({
features: {
imageEditor: {
tools: {
filter: { icon: 'magic-wand-sparkles' },
crop: { icon: 'https://example.com/icons/crop.svg' },
draw: { icon: '<svg viewBox="0 0 24 24">…</svg>' },
resize: { enabled: false },
},
},
},
});

When the icon string cannot be resolved, the editor falls back to the default icon for that tool.

Translations

The image editor ships with built-in translations for the locale you pass to unlayer.init({ locale }) and falls back to English when a locale is not yet available. You can override any string — or supply translations for a brand-new locale — through the same translations config you use for the rest of the editor (see Localization). All image editor keys are grouped under the image_editor.* prefix.

If your project uses @unlayer/types, every translation key (and the rest of the unlayer.init config) is fully typed, so your editor will autocomplete the keys below as you write them.

unlayer.init({
locale: 'fr-FR',
translations: {
'fr-FR': {
'image_editor.toolbar.save': 'Enregistrer',
'image_editor.tools.filter': 'Effets',
'image_editor.ai_assistant.placeholder':
'Décrivez ce que vous souhaitez modifier…',
},
},
});
All image editor translation keys

Toolbar

KeyDefault
image_editor.toolbar.saveSave
image_editor.toolbar.cancelCancel
image_editor.toolbar.applyApply
image_editor.toolbar.undoUndo
image_editor.toolbar.redoRedo
image_editor.toolbar.zoom_inZoom in
image_editor.toolbar.zoom_outZoom out
image_editor.toolbar.fit_to_screenFit to screen
image_editor.toolbar.show_chatShow chat
image_editor.toolbar.hide_chatHide chat

Side nav tools

KeyDefault
image_editor.tools.filterFilter
image_editor.tools.cropCrop
image_editor.tools.resizeResize
image_editor.tools.drawDraw
image_editor.tools.textText
image_editor.tools.shapesShapes
image_editor.tools.stickersStickers
image_editor.tools.frameFrame
image_editor.tools.cornersCorners
image_editor.tools.mergeMerge

Inline actions, filters, and object labels

KeyDefault
image_editor.actions.doneDone
image_editor.actions.dismissDismiss
image_editor.filters.brightnessBrightness
image_editor.filters.blurBlur
image_editor.filters.noiseNoise
image_editor.filters.sharpenSharpen
image_editor.filters.colorColor
image_editor.filters.grayscaleGrayscale
image_editor.labels.textText
image_editor.labels.shapeShape
image_editor.labels.stickerSticker
image_editor.labels.drawingDrawing
image_editor.labels.imageImage

AI Assistant

KeyDefault
image_editor.ai_assistant.nav_labelAI
image_editor.ai_assistant.titleAI Assistant
image_editor.ai_assistant.empty_stateChoose or describe an edit
image_editor.ai_assistant.placeholderDescribe what you want to change…
image_editor.ai_assistant.editingEditing…
image_editor.ai_assistant.progress.analyzingAnalyzing image…
image_editor.ai_assistant.progress.applyingApplying changes…
image_editor.ai_assistant.progress.finalizingFinalizing…
image_editor.ai_assistant.doneThe changes have been applied.
image_editor.ai_assistant.abortedGeneration cancelled.
image_editor.ai_assistant.errorOur AI service is temporarily unavailable. Please try again in a few minutes.
image_editor.ai_assistant.suggestions.remove_backgroundRemove the background
image_editor.ai_assistant.suggestions.vintageMake it look vintage
image_editor.ai_assistant.suggestions.brightnessIncrease brightness
image_editor.ai_assistant.suggestions.black_whiteConvert to black & white
image_editor.ai_assistant.suggestions.blur_backgroundBlur the background
image_editor.ai_assistant.suggestions.warm_toneAdd a warm tone
image_editor.ai_assistant.suggestions.sharpenSharpen the image
image_editor.ai_assistant.suggestions.remove_textRemove text from image