Image Editor

Builders

Image Editor

Crop, rotate, flip, resize and filter images, baked into a new image, ready to send.

The image editor's server-side engine ships in mailkaro-headless. Apply an edit set to any image and get the transformed bytes back:

tsedit.ts
import { applyImageEdits } from "mailkaro-headless";

const out = await applyImageEdits(inputBytes, {
  crop: { x: 0, y: 0, width: 800, height: 400 }, rotate: 90, grayscale: true,
});
// store `out` on your CDN and swap the image URL

Operations apply in a fixed order: crop → rotate → flip → resize → brightness → contrast → grayscale → blur. Install jimp alongside (loaded on demand, like Puppeteer for export), and store the result with your upload handler.

The editor UI#

The interactive panel ships as ImageEditorPanel (from react-email-craft), rotate, flip, brightness / contrast and grayscale controls over a live preview. On save it emits the same edit set you hand to applyImageEdits:

tsx
import { ImageEditorModal } from "react-email-craft";

<ImageEditorModal
  src={url}
  open={editing}
  onSave={(edits) => bakeAndUpload(edits)}   // → applyImageEdits on your server
  onClose={() => setEditing(false)}
/>

Use ImageEditorPanel for an always-on panel, or ImageEditorModal to open it as a dialog. Both emit the same edit set for applyImageEdits to bake server-side.

Binding the modal to an image block's double-click on the canvas is the final, visual integration step.