Image Search v3
Image Search v3 is a powerful Anki add-on that lets you quickly find and add images to your cards directly from the editor. It searches for images based on the content of your fields or selected text and places the chosen image into a designated field.
Update (2025-10-31)
- 
Smart Replace now replaces only images inserted by this add-on (identified by class=“imgsearch”) and never overwrites existing text or manually pasted images; if no prior add-on image exists, it appends instead. 
- 
Default placement is “replace” in code and settings, but it remains non-destructive: original field content is preserved and only prior add-on images are swapped. 
- 
Right‑click context menu is registered using gui_hooks.editor_will_show_context_menu with a legacy fallback for older builds, so “Search image for selection” appears reliably. 
- 
Yandex request pipeline hardened: explicit timeouts, limited retries with backoff, and robust JSON checks to avoid KeyError/TypeError on slow or offline networks. 
- 
Media downloads are offline-aware: quick DNS check, structured error codes (offline/network/unexpected), and a single concise user message instead of duplicate popups. 
- 
Per-note-type settings dialog: Save no longer closes the dialog; defaults initialize placement to “replace,” first field for queries, and last field for images. 
- 
Safer field resolution: if a configured image field is missing, the add-on falls back to the last field and warns; query field selection falls back to the first field. 
- 
Default config simplified: global image_field removed; query_fields defaults to [“Front”] for cleaner per-note-type configuration. 
Features
- Yandex Image Search: Exclusively uses Yandex to find images.
- Per-Note-Type Configuration: Configure different query and image fields for each of your note types.
- Graphical Settings Panel: An easy-to-use settings panel to manage your configuration. No more manual file editing!
- Smart Defaults: Automatically uses the first field of a note type for searching and the last field for placing the image if not configured otherwise.
- Search on Selection: Simply highlight any text in the editor and use the search button or right-click context menu to search for an image.
- Toolbar Integration: Adds “Search”, “Previous”, and “Next” image buttons directly to the Anki editor toolbar for a fast workflow.
- Right-Click Context Menu: Right-click on highlighted text to instantly start an image search. [broken?]
Usage
1. Configuration
Before using the add-on, it’s best to configure it for your note types.
- Go to Tools → Image Search v3 Settings from Anki’s main window.
- The settings dialog will open. On the left, you will see a list of all your note types.
- Select a note type from the list.
- On the right, you can now configure that note type:
- Query Fields: Select one or more fields that the add-on should use to get the search query.
- Image Field: Select the field where the add-on should place the found image.
 
- If you don’t configure a note type, the add-on will default to using the first field for the query and the last field for the image.
- You can use the “Reset to Default” button to revert the settings for the selected note type to this default behavior.
- Click Save to store your settings.
Note: This add-on uses Yandex as its exclusive image search provider. The option to choose a different search engine has been removed.
2. Searching for Images
There are three ways to search for an image in the card editor:
- Using the Toolbar Button: Click the “Search Image” button (the picture icon) on the editor toolbar.
- If you have text highlighted anywhere in the editor, that text will be used for the search.
- If no text is highlighted, the content of your configured Query Field(s) will be used.
 
- Using the Right-Click Menu: Highlight the text you want to search for, right-click it, and select “Search image for: ‘…’” from the context menu.
- Browsing Results: Use the “Previous Image” and “Next Image” buttons (the arrows) to browse through other image results for the last query that was performed from the query field(s).
Troubleshooting
Context Menu Item Not Appearing
If the “Search image for…” option does not appear when you right-click on selected text, it might be due to a conflict with another add-on that also modifies the context menu. A common conflict is with add-ons that provide image editing or other right-click functionalities in the editor.
You can diagnose this by temporarily disabling other editor-related add-ons (like “Image Editor”) via Tools → Add-ons, restarting Anki, and checking if the menu item appears.
License
This add-on is a modification of the work of original authors. Credit goes to the creators of Anki Image Search v2 and Image Search.
The icons are provided by Open Iconic.
This project is licensed under the GPLv2.



