Save and export
Use the editor from the quickstart. Keep the source image and annotation state together when users need to reopen their work.
const state = editor.getState();
const json = JSON.stringify(state);
editor.restoreState(JSON.parse(json));
Create a flattened PNG
import { Renderer } from 'reticlejs';
const png = await new Renderer().toBlob(image, editor.getState(), {
imageType: 'image/png',
});
Use the blob as a download or pass it to your application's attachment workflow. Keep the original and editable state in storage appropriate for the source image's sensitivity.
Review sensitive details
Inspect suggested regions and add missed regions manually. Blur and pixelation can leave information recognizable. Inspect the actual raster before sharing. Editable SVG can contain the original image underneath overlays. The JSON describes edits and may include user-entered text.
Image editing runs in the browser. Optional vision and OCR providers may download runtimes or model assets. Account for those downloads when planning offline operation. Benchmark scores describe the recorded test corpus.
Attach the reviewed PNG to a ticket
Try the support ticket demo. Cover a detail, inspect the recipient preview, and choose Attach to sample ticket. On the sample ticket, Cover the sample email places a cover in one action. For your own image, open Place a cover by coordinates under Regions. Tab to a cover in the list and use the arrow keys to fine-tune its position. Review attachment jumps to the flattened preview. Further edits stay in the editor until you choose Replace ticket attachment.
The playground dispatches a bubbling reticle:attach event on the editor when the user approves the current PNG. Its payload contains one File. In a host application, connect that event to your existing attachment input or uploader. Here is a browser-only example for a form with a file input named attachment:
editor.addEventListener('reticle:attach', ({ detail: { file } }) => {
const files = new DataTransfer();
files.items.add(file);
document.querySelector('input[name="attachment"]').files = files.files;
});
If you are implementing the review button yourself, construct the file from the same PNG blob shown in the recipient preview. Clear the pending download and disable approval whenever the document changes, until the new preview is ready.