Image Occlusion addon for Anki

Download .zip Download .tar.gz View on GitHub

Image Occlusion 2.0 User Manual

Author Contact:


This addon allows you to add image occlusion cards to Anki. Image occlusion cards are like cloze deletions with graphics.

In general, you hide parts of an image, and during the repetitions you must guess what the hidden part is.

Image Occlusions are discussed in the esupermemo website ( test).

In practice, you will often have an image with labels, and you will hide the labels which you want to guess during the repetitions. Because an image is worth 1000 words (this are just one of 38 cards generated at once from the original image):


Basic usage

The addon is very simple. In the note editor, a new button has appeared, containing the text Image Occlusion (ignore the cute panda, the lightning bolt icon and the grey snowflakes near the fields; they are from some of my other addons. If you are curious, please see check these: panda, lightning bolt, snowflakes).

To add new Image Occlusion cards to your collection, click that button. You will be asked to choose an image file to generate cards from it. Choose the file, and a new window will appear, with an image editor containing the image ready for you to edit. You generate Image Occlusion cards by drawing shapes (or masks) over the original image. There are several shapes you can draw, and you can group shapes together to cover non-contiguous parts of the image. In the vast majority of cases you will want to use rectangles.
Let's see how everything is processed from the begining:

Step by Step instructions


Open the note editor (by clicking Add in the deck browser, for example)


Click the Image Occlusion button


Choose the image file you want to use (I chose an image from Netter's atlas, depicting a deep dissection of the muscles of the thigh).
You can also use an image from the clipboard.


An image editor will appear.
Besides showing the editing area, the current version allows you to supply (optionally, of course):
  1. Header: is shown above the images when studying
  2. Footer: is shown below the image when studying
  3. Tags: are added to the notes. This is how you supply tags to the Image Occlusion cards. Changing the tags in teh note editor doesn't affect the tags of the Image Occlusion cards.
You can also select the deck to which your cards will be added, by clicking the button at the bottom. This button works just like the Choose Deck dialog in the Anki note editor.

These images don't show these features because they are from the previous version. They have not been updated due to lack of time.


You can now start to draw rectangles over the labels you want to hide in your image.


The initial tool is the rectangle tool, so you can start drawing rectangles right away. The rectangles are initially set to white, but the color can be changed in the color panel in the bottom of the screen. The rectangle tool is marked with an arrow in the following screenshot:


Repeat for all labels


Now that all labels are hidden, you must add the cards to Anki. To add the cards, you click one of the following buttons (their meaning will be discussed later):


A tooltip will appear telling you how many cards have been added.
Congratulations: you have added your first image occlusion note.

Meaning of the buttons

There are two buttons:

1. Non-overlapping
Non-overlapping   (Mnemonic: notice that the two shapes don't overlap)
2. Overlapping
(Mnemonic: notice that the two shapes overlap)

Non Overlapping

This button is called non-overlapping because it generates cards in which there is no overlapping information.
This is because the question side of the cards hides all labels, hiding the label the user is supposed to guess in a different color, and the answer shows only that layer (and none of the other layers). This is the same as showing a cloze deletion sentence with all parts hidden, while asking only for one of them. For example:



This button is called overlapping because it generates cards in which there is overlapping information.
This is because the question side of the cards shows all labels except for the one the user is supposed to guess, and the answer shows all labels. This is the same as showing a cloze deletion sentence with only one cloze for the user to guess. For example (compare with the previous one):

Which one do I use?

That depends on the material you're adding, as wel as your personal preferences.
I believe that for images that consist of a drawing with some labels pointing to parts of the image, non-overlapping image oclcusion is better, because it deprives the user of clues that might help him to answer the answer correctly without being really sure. A user that can see all labels except for one might easily be able to guess the missing one. Despite this conjecture, I have no data showing the superiority of either method in this situation.
In images where context is critical, like a diagram representing a biochemistry cycle (e.g. Krebs cycle), in chich the compounds come one after the other, you have to use overlapping image occlusion. You can't guess the that a label is hiding compound B, for example, unless you can see that it comes from A and becomes C.
Here is an example of overlapping image occlusion being used on a diagram of the Krebs cycle:

With non-overlapping image occlusion you would have to memorize the place of fumaric acid in this specific drawing of the cycle. With overlapping image occlusion, you have only to memorize which compound comes from succinic acid and turns into malic acid, which is exactly our goal.

Advanced Use

Adding Images from the clipboard

If you have an image in the clipboard (a screenshot, for example), when you click the Image Occlusion button, the addon will not ask you for a filename, and will use the image in the clipboard. The image will be cleared from the clipboard imediately after appearing in the image editor. If clearing the clipboard is inconvenient for you, drop me a line and I will make this customizable.

Beyond Rectangles

Although the previous discussion used rectangles as an example, you can use any kind of shapes, or even a group of shapes to hide parts of the image. Using a group of shapes might be useful if you want to hide two non contiguous parts of the image. See this link for a turorial on the use of the editor, which includes instructions on how to group/ungroup objects.
Here is an example of using a group of two rectangles to hide two different chemical compounds in the Krebs cycle:


Why do I choose to hide them at the same time? Well, anyone who knows some biochemistry knows that if you see NAD+ in one side of a chemical reaction, NADH will appear on the other side (not always, but incredibly often in human metabolism). If you are shown one of them, guessing the other requires no knowlege of the specific chemical reaction you are studying. We want to test our knowlege of the Krebs cycle, and not whether or not we know a basic rule of thumb, and so we hide both compunds at the same time. Because these two compounds are so closely associated at this stage (to understand the Krebs cycle you need to know the basics, namely what NAD+ and NADH are), the pair works as a single chunk, and we are not contradicting the minimum information principle.

Edit the image before placing the masks

You can edit the image to before hide the masks. The editor contains a side panel named layers. If you click the word layers, it will appear. By default, the Shapes layer is active, which means that whatever you draw is interpreted as a mask to hide part of the image.

However, if you select the Picture layer (by clicking it), you will be able to draw over the image in a way that is not interpreted as masks hiding the image. When you want to draw the masks, you just select the Shapes layer again.

Further reading

For documentation on how to use the editor, see the official website.

Changing Default Options

As of the current version, you can change:
the default color of the rectangles in the editor [default value is white]. Please note that you can also change the rectangle color in the editor itself.
the color of the rectangle that appears in the question [default value is red, as in the examples shown]. You can't change this option in the editor.
To change configure this options, go to the Tools > Image Occlusion 2.0 (options) menu, as shown in the picture:

The following window will appear:

Click the Choose Color buttons, and you will be presented with a color palette from which you can choose a color.


You can access this help from the help menu of Anki's main window:

Plans for the future

Being able to update image occlusion notes, while preserving some of the review history.
Suggestions are accepted and deeply appreciated.


What is this editor you're using? it is svg-edit, a javascript editor that is available in the official website. None of the core code has been touched, and only an extension has been written.

Where is the place to go to know more about this editor? You can go to the official website. It contains lots of documentation, and can give you ideas on how to use the full power of svg-edit to your image occlusion workflow (I have to say that in my opinion most of the time nothing beats the old rectangle). This tutorial is also very helpful.

Sometimes, the editor refuses to appear correctly. Why? Please make sure you have the most current version of the addon, which is "Image Occlusion version 2.1", as indicated in the ankiweb page.

Can I add images from the clipboard? YES YOU CAN! :)

I have another question! Contact the author: