How can i set auto zoom into masked area of image (card made withImage Occlusion Enhanced) )

i have fairly large image when making card with Image Occlusion Enhanced , now when i press study button , the image show up but because it is large , it is not readable . any way so that anki will automatically zoom into part of image where i have masked image . if this can be done please suggest how

This script may still work:

First of all Thanku @kleinerpirat for your reply

Actually i am pretty new to anki and doesn’t know about scripting also .

Can you be please kind to give steps where i have to add this script in my anki desktop. I am using latest version of anki .

Thanks again

Either select one of your IO notes in the browser or choose the notetype in the Add window. Then click on “Cards…”:

Then add the JS wrapped in a <script> tag into the Front Template, like this:

  /** Auto-scroll for Image Occlusion Enhanced
  * @author Matthias Metelka <>
  (async function () {
     const img = document.querySelector("#io-overlay>img");
     const file = await fetch(img.src);
     const mask = new DOMParser()
         .parseFromString(await file.text(), "image/svg+xml")

     mask.removeAttribute("width"); = "position: absolute; top: 0; right: 0; bottom: 0; left: 0;";
     img.parentNode.insertBefore(mask, img);

         block: "center",
         inline: "center",

thanks @kleinerpirat it is working fine on my desktop anki now.

is their any workaround or other solution to do same on my ankidroid ?

as because on ankkidroid it is not working

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.