Free tool · For websites

The image editor on your website

Paste an empty div and one script tag, and the free AI Web Center image editor appears on your page. Visitors open, drop or paste a photo and edit it in their own browser: crop, resize, adjust, text, blur, watermark, remove a spot or the background, strip the GPS location. Nothing is uploaded. With data-save=“page” the finished photo goes into your form’s file field instead of a download, in the format and size your form takes, so your server gets a cropped, resized photo and doesn’t change.

Last updated

Two lines on your page

Paste these where the editor should appear:

<div class="aiwc-image-editor"></div>
<script src="https://aiwebcenter.com/embed/image-editor.js" async></script>

That’s all. Visitors open, drop or paste a photo and edit it in their own browser. Nothing is uploaded, to your server or to ours.

It’s only the editor: no sample photos, no other tools. Which tools show, and what happens when a visitor is done, is up to you.

Questions or help setting it up: support@aiwebcenter.com.

Live: the embedded editor as your visitors first see it. Drop a photo on it to try it. It stays in your browser.

Edited before it’s uploaded

With data-save="page" the finished photo goes to your page instead of the visitor’s downloads. Point data-input at the file field of your form and it’s filled in, in the format and size your form takes. Your server gets a cropped, resized photo without its GPS location, and doesn’t change at all.

Live: open or drop a photo, edit it, and press Use this photo. It arrives below as it would in your form: a JPEG under 300 KB, at most 1,600 pixels, without hidden data. Nothing leaves your browser.

The form’s photo field is empty.

Headshots, retouched before they’re uploaded

For a team page, an agent or doctor profile, or a member directory. data-tab="retouch" opens each photo on Retouch: smoother skin, lighter under-eyes, whiter teeth, a firmer jawline. A face model finds the face in the visitor’s browser. Below, the plugin itself, with our sample headshot: pick a look, press Use this headshot, and the form gets it.

The form’s headshot field is empty.

<form action="/team/photo" method="post" enctype="multipart/form-data">
  <input type="file" name="headshot" id="headshot" hidden>
  <div class="aiwc-image-editor" data-tools="crop,retouch,background,export" data-tab="retouch"
       data-save="page" data-input="#headshot" data-done="Use this headshot"
       data-format="jpeg" data-max-side="800" data-max-kb="200"></div>
  <button>Save my photo</button>
</form>
<script src="https://aiwebcenter.com/embed/image-editor.js" async></script>

Every option

Add any of these to the div.

OptionExampleWhat it does
data-file/photos/house.jpgAn image to open: your page reads it, so images behind a login work
data-toolscrop,resize,adjust,exportOnly these tools: crop, resize, adjust, filters, retouch, draw, hide, watermark, remove, background, info, export. Default: all
data-tabretouchThe tool each image opens on, such as retouch for a headshot uploader. Default: the first tool
data-savepagedownload (the default): visitors save the file. page: the finished image goes to your page instead
data-input#photoWith data-save="page": the <input type="file"> in your form that gets the finished image
data-doneUse this photoWith data-save="page": the label of the button that finishes. Default: Done
data-formatjpegThe format it’s saved in: jpeg, png, webp, avif, gif, pdf, tiff or bmp
data-max-kb300At most this many kilobytes: the highest quality that fits, smaller if it must
data-max-side1600At most this many pixels on the longest side
data-height820pxThe editor’s height. Default 760px
data-accent#2563ebYour color for buttons and highlights, in place of the magenta. #rgb or #rrggbb

To open an image your page already has in memory, call AiwcImageEditor.open(element, { name: "photo.jpg", data: arrayBuffer }).

Recipes

Headshots for profiles and team pages

A team page, an agent or doctor profile, a speaker list or a member directory: people crop their photo, retouch it, put it on a plain background, and it arrives as an 800-pixel JPEG under 200 KB.

<form action="/team/photo" method="post" enctype="multipart/form-data">
  <input type="file" name="headshot" id="headshot" hidden>
  <div class="aiwc-image-editor" data-tools="crop,retouch,background,export" data-tab="retouch"
       data-save="page" data-input="#headshot" data-done="Use this headshot"
       data-format="jpeg" data-max-side="800" data-max-kb="200"></div>
  <button>Save my photo</button>
</form>
<script src="https://aiwebcenter.com/embed/image-editor.js" async></script>

Photos edited before they’re uploaded

A listing, a profile or a support form: visitors crop, straighten and brighten their photo, and it arrives in your form as a JPEG under 300 KB, without its GPS location. Your form uploads it as it uploads any file.

<form action="/profile" method="post" enctype="multipart/form-data">
  <input type="file" name="photo" id="photo" hidden>
  <div class="aiwc-image-editor" data-save="page" data-input="#photo"
       data-done="Use this photo" data-format="jpeg" data-max-kb="300" data-max-side="1600"></div>
  <button>Save my profile</button>
</form>
<script src="https://aiwebcenter.com/embed/image-editor.js" async></script>

Your own code takes the photo

Without a form, listen for the event: event.detail.file is the finished image, ready to send with fetch.

<div id="editor" class="aiwc-image-editor" data-save="page"></div>
<script src="https://aiwebcenter.com/embed/image-editor.js" async></script>
<script>
  document.getElementById("editor").addEventListener("aiwc-image-saved", (e) => {
    const body = new FormData();
    body.append("photo", e.detail.file);
    fetch("/api/photos", { method: "POST", body });
  });
</script>

A simple editor for your readers

A blog, a club or a school site: crop, resize, add text and save, nothing else.

<div class="aiwc-image-editor" data-tools="crop,resize,adjust,draw,export" data-accent="#2563eb"></div>
<script src="https://aiwebcenter.com/embed/image-editor.js" async></script>

An image your page already has

If your page holds the image in memory, hand it over directly.

<div id="editor"></div>
<script src="https://aiwebcenter.com/embed/image-editor.js" async></script>
<script>
  AiwcImageEditor.open(document.getElementById("editor"), { name: "photo.jpg", data: arrayBuffer });
</script>

If something doesn’t work

  • “The image on this page could not be loaded”Your page couldn’t read data-file. Check the address. If the image needs a login, the visitor has to be signed in. An image on another server needs that server to allow your site to read it (Access-Control-Allow-Origin with your site’s address).
  • Nothing shows, not even the frameYour site’s Content-Security-Policy may block it. Allow script-src and frame-src https://aiwebcenter.com.
  • The form’s file input stays emptydata-input must point at an <input type="file"> on the same page, for example data-input="#photo", and data-save must be "page". The div also gets the aiwc-image-saved event, if you’d rather handle it yourself.
  • Paste doesn’t work inside the editorClick into the editor first, so the paste goes to it. The script allows clipboard use in the frame; a site that sets its own Permissions-Policy has to allow it too.
  • The editor is crampedRaise data-height. Below about 1,000 pixels wide the tools move under the image.

Still stuck? Email support@aiwebcenter.com with the page’s address and we’ll help.

What the editor sends

  • The photoNever. It’s opened, edited and saved in the visitor’s browser. With data-save="page" it goes to your page, in the same browser, and from there only where your page sends it.
  • CountsThat the editor loaded on your site, that an image was opened and saved, its format and which tools were used, with your site’s name. Never a file name, a picture or anything about the visitor.
  • The Background and Retouch toolsTheir AI models, from Google’s MediaPipe, download from aiwebcenter.com and run in the visitor’s browser. The photo isn’t sent to an AI service.
  • CookiesNone.

Free, with a credit

The editor is free and stays free. It shows a small AI Web Center strip with links to our site, and a credit link above it. Please leave both in place.

Frequently asked questions

Does it cost anything?

No. The editor is free for any website. It shows a small AI Web Center strip with links to our site, and a credit link above it.

Is the photo uploaded to you?

No. It's opened, edited and saved in the visitor's browser. With data-save="page" it goes to your page, in the same browser, and from there only where your page sends it. The editor only counts that it loaded on your site, that an image was opened and saved, the format and which tools were used, with your site's name; never a file name or a picture.

Can the edited photo go into my upload form?

Yes. Add data-save="page" and data-input with your file field, for example data-input="#photo". When the visitor presses the button (its label is yours, with data-done), the finished photo is put in that field, and the form uploads it like any file. data-format, data-max-kb and data-max-side make it fit your form's rules.

Which tools can I show?

Any of crop, resize, adjust, filters, retouch (faces in portraits), draw (text and shapes), hide (blur and black boxes), watermark, remove, background, info (the hidden data) and export, in data-tools. Leave it out for all of them.

Which files open?

JPEG, PNG, iPhone HEIC, WebP, AVIF, JPEG XL, GIF, TIFF, camera RAW files, PDF pages, BMP, ICO, SVG and Photoshop PSD, opened, dropped or pasted. Your page can also hand one over with data-file.

Does it show your sample photos?

No. The embedded editor is only the editor. What it opens is up to your site and your visitors.

Sources

  1. MDN: Window.postMessage(). How your page and the editor hand the photo to each other
  2. MDN: DataTransfer. How the finished photo is put in your form's file field
  3. MDN: Content-Security-Policy frame-ancestors. Why only the embedded editor may be shown inside other sites
  4. MediaPipe Interactive Segmenter (Google for Developers). The model behind the Background tool, run in the visitor's browser; Apache-2.0