IMAGE TAGGING

The Image Tagging extension extracts the text from an image and outputs it into Roam!

Installation

You could use the Copy Extension button below to individually install this extension. To install, just paste anywhere in your Roam graph and click "Yes, I Know What I'm Doing".

Manual Installation

If the extension doesn't work after using the copy extension button above, try installing manually using the instructions below.

First create a block with the text {{[[roam/js]]}} on any page in your Roam DB. Then, create a single child of this block type three back ticks. A code block should appear. Copy this code and paste it into the child code block in your graph:

var existing = document.getElementById("roamjs-image-tagging");
if (!existing) {
  var extension = document.createElement("script");
  extension.src = "https://roamjs.com/image-tagging.js";
  extension.id = "roamjs-image-tagging";
  extension.async = true;
  extension.type = "text/javascript";
  document.getElementsByTagName("head")[0].appendChild(extension);
}

Finally, click "Yes, I Know What I'm Doing".


Usage

Hover over an image in your database. On hover, a magnifying glass icon with a T will appear near the Roam native block edit icon. Clicking the extension will use an OCR library to extract all the text found in an image. In the meantime, it will insert a "Loading..." text as a child block. Once the extension finishes, it will replace the Loading text with all the new text it parsed from the image.

If the text begins with a bullet or dash on a line, the bullet will be stripped, leaving the rest of the text content.

Triggers

By default, the trigger the extension uses to perform the text extraction is ICON CLICK. To change this to a different trigger create a page called [[roam/js/image-tagging]]. On it, create a block with the Trigger:: attribute and map it to one of these three supported values:

  • DOUBLE CLICK
  • SHIFT CLICK
  • ICON CLICK

Demo


Contributors

This extension is brought to you by RoamJS! If you are facing any issues reach out to support@roamjs.com or click on the chat button on the bottom right.

If you get value from using this extension, consider sponsoring RoamJS by clicking on the button below!

Other Extensions