# Image Occlusion – Make Image Field Visible

**URL:** <https://forums.ankiweb.net/t/image-occlusion-make-image-field-visible/55482>\
**Category:** Suggestions\
**Created:** [February 6, 2025, 5:56pm UTC](https://forums.ankiweb.net/t/image-occlusion-make-image-field-visible/55482 "2025-02-06T17:56:58Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![NameLessGO](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/namelessgo/32/34298_2.png) [@NameLessGO](https://forums.ankiweb.net/u/NameLessGO)\
**Post date:** [February 6, 2025, 5:56pm UTC](https://forums.ankiweb.net/t/image-occlusion-make-image-field-visible/55482/1 "2025-02-06T17:56:58Z")

</div>

Hello, im using [AJT Media Converter / WebP, AVIF](https://ankiweb.net/shared/info/1151815987) to compress images with AVIF, but image occlusion “paste from clipboard” bypasses the add-on and paste jpg.

Not sure if an add-on fix is possible, but another workaround would be to unhide the image field in the editor

Image Occlusion enhanced is an alternative, you have to manually edit every card with the compressed image, while the built-in requires changing one

 ![image](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/5/7/576e59ce39b609f12f456ff8d491d0fba7f1654a.png)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/a/d/adfae17b35fd443c4595a9e50a95fb48f78bb597.png)

---

<div class="post-metadata">

**Author:** ![Danika\_Dakika](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/danika_dakika/32/17815_2.png) [@Danika\_Dakika](https://forums.ankiweb.net/u/Danika_Dakika)\
**Post date:** [February 6, 2025, 6:34pm UTC](https://forums.ankiweb.net/t/image-occlusion-make-image-field-visible/55482/2 "2025-02-06T18:34:11Z")

</div>

> [@NameLessGO](#):
>
> another workaround would be to unhide the image field in the editor

Perhaps this PR giving more direct access to IO images will help with that?

> <https://github.com/ankitects/anki/pull/3779>
>
> Relevant forum post: https://forums.ankiweb.net/t/unable-to-find-image-source-in…-note-type-image-occlusion/54940
> 
> There's currently no easy way to get at an IO note's image on disk, since the field is hidden the only practical means are through code or by squinting at the \`Question\` or \`Answer\` columns in the browser
> 
> The "show image in folder" (win/mac) and "open image" context menu actions for images were added in
> \- https://github.com/ankitects/anki/pull/3412
> \- https://github.com/ankitects/anki/pull/3431
> 
> This pr proposes to extend them to IO, by showing those actions when right clicking on the mask editor, allowing users to open the image file that's used in the current IO note, in their media folder

---

<div class="post-metadata">

**Author:** ![NameLessGO](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/namelessgo/32/34298_2.png) [@NameLessGO](https://forums.ankiweb.net/u/NameLessGO)\
**Post date:** [February 6, 2025, 7:07pm UTC](https://forums.ankiweb.net/t/image-occlusion-make-image-field-visible/55482/3 "2025-02-06T19:07:54Z")

</div>

Its more troublesome than simply unhiding the image field tbh, but ig it would work, but instead of changing in Anki, the user would require to download the avif image and open the file app to change it

For instance the workflow on basic or cloze is:

Paste image in field \> AJT compress and convert image \> outputs AVIF

 ![image](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/d/a/da59d539ad89f958b970030c722cd793e0b7ba0f.png)

* * *

@tatsumoto Would be possible for AJT Media to paste avif/webp in Image Occlusion?

---

<div class="post-metadata">

**Author:** ![tatsumoto](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/tatsumoto/32/5411_2.png) [@tatsumoto](https://forums.ankiweb.net/u/tatsumoto)\
**Post date:** [February 6, 2025, 8:08pm UTC](https://forums.ankiweb.net/t/image-occlusion-make-image-field-visible/55482/4 "2025-02-06T20:08:15Z")

</div>

> [@NameLessGO](#):
>
> @tatsumoto Would be possible for AJT Media to paste avif/webp in Image Occlusion?

AJT Media Converter uses `gui_hooks.editor_will_process_mime`. If it finds an image file in the mime data, it converts it to webp or avif depending on the settings.

> [@NameLessGO](#):
>
> but image occlusion “paste from clipboard” bypasses the add-on and paste jpg.

I’ve heard about image occlusion before. If I’m right, it is when you have an image on the front of a flashcard and there’s a hidden piece that you need to recall. Are you talking about [this addon](https://ankiweb.net/shared/info/1374772155)? If so, it is possible that the add-on uses a different code path from what AJT Media Converter is designed to work with. I haven’t used it myself. If you teach me how to use it, I might be able to figure out why it doesn’t work.

---

<div class="post-metadata">

**Author:** ![Anon\_0000](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@Anon\_0000](https://forums.ankiweb.net/u/Anon_0000)\
**Post date:** [February 6, 2025, 8:11pm UTC](https://forums.ankiweb.net/t/image-occlusion-make-image-field-visible/55482/5 "2025-02-06T20:11:44Z")

</div>

NameLessGO seems to be using the build in image occlusion.

1. Open Anki.
2. Click on _Add_.
3. Choose card type _Image Occlusion_.
4. _Select Image_.
5. Draw a square somewhere.
6. Press _Add_ button.
7. Done.

---

<div class="post-metadata">

**Author:** ![tatsumoto](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/tatsumoto/32/5411_2.png) [@tatsumoto](https://forums.ankiweb.net/u/tatsumoto)\
**Post date:** [February 6, 2025, 9:14pm UTC](https://forums.ankiweb.net/t/image-occlusion-make-image-field-visible/55482/6 "2025-02-06T21:14:40Z")

</div>

Thanks, found it. Didn’t know Anki had such a feature lol. Is it intended to be used by regular users? Judging by how confusing it is, maybe it’s a hidden feature, and it’s not ready yet. However, if you press `"Edit" > "AJT Media Converter: Bulk convert"` then it converts the image correctly, so it’s not completely broken. The note editor is still broken though. I can only see the image in the Editor, and all fields are completely hidden. If I press “Fields”, I can see that the note has 5 fields, but none of them are shown in the Editor.

Here’s a script that can help you see the contents of a note (use the debug console to run it):

```python
from aqt import mw
note = mw.col.get_note(1234567890123)
for field in note.keys():
    print(f"{field}: {note[field]}")

```

---

<div class="post-metadata">

**Author:** ![NameLessGO](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/namelessgo/32/34298_2.png) [@NameLessGO](https://forums.ankiweb.net/u/NameLessGO)\
**Post date:** [February 6, 2025, 9:30pm UTC](https://forums.ankiweb.net/t/image-occlusion-make-image-field-visible/55482/7 "2025-02-06T21:30:29Z")

</div>

Didn’t considered Bulk convert, Thanks!

> [@tatsumoto](#):
>
> can only see the image in the Editor, and all fields are completely hidden

Also learned this recently, but you have to press Toggle Mask fields button next to Cloze and the remaining fields will appear  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/b/e/be75b908660f4c9fabe130e794ead991393e65ef.png)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/b/0/b0fec27d1fe10ca1b17a42f90a65252d232e4f1c.png)

---

<div class="post-metadata">

**Author:** ![tatsumoto](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/tatsumoto/32/5411_2.png) [@tatsumoto](https://forums.ankiweb.net/u/tatsumoto)\
**Post date:** [February 6, 2025, 9:36pm UTC](https://forums.ankiweb.net/t/image-occlusion-make-image-field-visible/55482/8 "2025-02-06T21:36:13Z")

</div>

Thanks for the tip! I can’t believe it’s so difficult to use. Why don’t just show the other fields under the image…

---

<div class="post-metadata">

**Author:** ![tatsumoto](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/tatsumoto/32/5411_2.png) [@tatsumoto](https://forums.ankiweb.net/u/tatsumoto)\
**Post date:** [February 6, 2025, 10:03pm UTC](https://forums.ankiweb.net/t/image-occlusion-make-image-field-visible/55482/9 "2025-02-06T22:03:28Z")

</div>

Apparently, when you press “paste image from clipboard”, Anki runs the function `select_image_from_clipboard_and_occlude()` and doesn’t call `gui_hooks.editor_will_process_mime()`. So I’m assuming the hook should be called after this line, but it is not:

> <https://github.com/ankitects/anki/blob/fab939e0e18d0bf7667c5ff86ff61c8960067f57/qt/aqt/editor.py#L1122>

And when you press “select image”, Anki runs `select_image_and_occlude()`.

There’s a method `setup_mask_editor()`. I think if AJT Media Converter wraps it, it could be sufficient to intercept and convert images before they’re shown.
