Option to resize image occlusion card image

I recently started using the native image occlusion cards, a feature that was added in 23.10. Thanks for adding this. I have a suggestion.

When I make a card, the image takes up the whole screen on my Windows desktop. So if I have added some “back extra” material, I have to scroll down the page to see it while I’m reviewing. It would be nice to have the option to resize the card to be smaller so I don’t have to scroll down. Perhaps a good implementation would be to have the option to select the whole card ((1) something quickly done like shift+click or alt+click or double click and (2) a button on the side), then click and drag from any of the now-selectable corners to increase or decrease the size of the card.

I think that is a reasonable idea.

Also, maybe you could try this workaround. I did not test it extensively, but it seems to work fine on my Anki Desktop 23.12.1.

  1. Create two new fields: IO_MaxHeight, IO_MinHeight.
  2. Add this code to the Front and Back templates:
#image-occlusion-container {
  max-height: {{text:IO_MaxHeight}}px;  
  min-height: {{text:IO_MinHeight}}px;

Basically, this workaround allows you to set a maximum/minimum height for your image occlusion cards, on a note to note basis, depending on the content of the IO_MaxHeight and IO_MinHeight fields.

For example, you can write 200 in the IO_MaxHeight field to set a maximum height of 200 px. Or you can write 800 in the IO_MinHeight to increase the minimum height to 800 px.
Since this does not affect the actual size of the images, there is no loss of quality and you can change the resizing as many times as you want.

If this does not work for you and/or you have any questions, please ask.

I tried but I couldn’t get it to work. I know next to nothing about coding so I’m sure I messed something up. That’s OK though, I appreciate the suggestion. :slightly_smiling_face:

Hopefully the devs will take my suggestion into consideration.


Would like to hear your thoughts on this idea, please. Is it a possibility?

You can adjust your card template to control how big the image gets: