Image Annotator - Allows you to annotate images in the previewer

AI-generated summary

The Image Annotator is a new Discourse Theme Component developed by chz062009 and vliboolean1010, allowing users to annotate images directly in the previewer with tools like boxes, arrows, text, and color customization. It supports major browsers and auto-saves annotations. A demo video and install screen are provided, with the repo hosted on GitHub. Early testing by davidkingham revealed cross-origin issues with S3-hosted images, later clarified as a local upload-to-S3 issue. Nam submitted multiple PRs to fix bugs, including one to remove jQuery and another to upgrade to markerjs2, which significantly reduced code and improved the editor. However, markvanlan reported UI glitches like misaligned toolbars and annotation placement, which Nam pledged to investigate. A critical bug was found where the component misparsed filenames with parentheses (e.g., (1)), corrupting markdown paths — Nam fixed this and plans to add hover-based options for annotation or cropping. sam praised the component’s potential and, after re-enabling it on Meta, provided UX feedback: unclear editor activation (suggesting a floating “Edit” or pencil icon), z-index conflicts with the composer requiring it to be minimized, and oversized edited images — suggesting preserving original dimensions. The component remains under active development with community collaboration.

Hi everyone,

Along with my teammate @vliboolean1010, we’re excited to introduce you to the newly created Discourse Theme-Component, Image Annotator.

Whenever you click on the image at the editor, it activates the features of

  • Add boxes, shapes, arrows, and text
  • Highlight or censor parts of the image
  • Select and change the color of the annotations
  • Annotated images will be automatically updated after clicking on the save.
  • Supports browsers including Safari, Firefox, Chrome & iOS Safari
  • (Image cropping feature is working in progress)

Install Screen

Repo: GitHub - discourse/discourse-image-annotator: image annotation theme component · GitHub

Demo Video

46 Likes

Nice work! Has this been tested with images hosted on s3? I’m getting a cross origin request error when s3 is enabled.

9 Likes

Thank you very much. It is awesome

7 Likes

Hi @davidkingham,

Thank you for the detailed reporting of the issue. As we are trying to solve this issue, one alternative solution will be uploading the image from your local devices, instead of uploading it from online sources. :slight_smile:

4 Likes

Thanks Chun, but that’s not the same thing. I am uploading from a local device but the image is being uploaded to an s3 endpoint and that’s where the problem comes in.

8 Likes

I’m thinking this could be used to automatically watermark photos by username, but I’m not sure how to go about that. Perhaps another button that prints [username]@[site domain]?

3 Likes

Is there a feature that can be scribbled on a photo

4 Likes

So here’s my problem. When I upload a large image (say, a screenshot of our forum for a tutorial) it automatically restricts the image display based on my max image settings. This is a problem because if it’s a large image, then it resizes it to impossibly small, and I can’t edit the larger version.

Basically, this restricts it to being useful only for images smaller than oneboxed settings; ours are (for example) set to 400 x 400.

In this image, these are the same two images, one edited with this component. The component renders it illegible.

If you could set it up so it can edit the original image, not the oneboxed version, that be absolutely stellar.

Great start though, and I definitely see its utility!

4 Likes

Is it possible to edit annotations after the post has been saved?

3 Likes

IT doesn’t look like it. It re-saves the image when you’re done editing.

4 Likes

Currently there are no features of that kind.

4 Likes

Write images error

ftOaYJktEr

2 Likes

I have moved this to #customization:theme:broken-theme and adding the pr-welcome tag on it.

I feel it needs a fair bit of work and support to be a proper recommended theme component.

6 Likes

I fixed some issues with annotating the images.
This is the link to the PR:
https://github.com/discourse/discourse-image-annotator/pull/49#issue-655300799

6 Likes

Awesome, thanks Nam. It doesn’t error anymore and does save the image, so that’s cool

I did notice while creating the masterpeice above, that there are quite a few little annoying things about using this. A number of times I had the annotation initialize at the wrong area. The toolbar but also the editing area were shifted half-way down the page. Do you think you can track down why this is happening?

6 Likes

Here is the link for the PR for removing Jquery:

7 Likes

I wonder if we can add “crop” and “rotate” controls to the component, seems like something that would be super useful.

9 Likes

I will look into it as soon as possible!

6 Likes

No rush at all, very excited to see this component getting some attention, it has so much potential.

9 Likes

While working with @markvanlan, we realized there is a new version of markerjs.
Images can be edited in the popup. This will take care of a lot of issues.
I’m working on a PR now.

9 Likes