Image occlusion masks are slightly blurry and have low border contrast in dark mode

Is your feature request related to a problem? Please describe.
When creating image occlusion masks for image occlusion cards (not enhanced cards), the masks seem to appear slightly blurry and jagged around the edges. There is also very poor contrast between the mask edge and the background in dark mode . I am using Ubuntu 22.04 and have installed it as recommended in the manual. Below is a picture to show what I mean about the line’s poor quality:

The screenshot has been taken during a review of cards in light mode. This is also visible in the browser. In dark mode, there also is very little contrast between the border and the background:

Describe the solution you’d like
I would like it so that the edge is not jagged and blurry. It should be a smooth solid line, like what would be possible if the masks were SVGs. In dark mode, the mask colour should slightly lighten so that there is contrast between the background and the mask (an example colour could be the one of the text on the screen which is #808080 or a much lighter grey/white could be chosen as a default)

Describe alternatives you’ve considered
I think but I am not sure that anki is not using SVGs for this internally from this pull request. If that is the case, such a element which is both smooth and can change colour will be harder. With an SVG, you can use currentColor or even:

@media (prefers-color-scheme:dark) {
  :root {
<!--dark mode only set of colours can go here-->
  }
}

These methods may differ in their ability to work if the svgs are not inlined but are in an <img> tag.

I spend some time and I’ve been able to consistently reproduce this.

  1. Create an image occlusion card


    I created this with a completely random picture and used very thick borders to emphasise that at the start the lines are indeed smooth and are not blurry

  2. Open the deck to start reviewing the card.

  3. Resize the window from full screen, any size smaller than the original will work but making it as small as possible maximises the effect

  4. Click show answer, your answer (again, hard, good, easy) and then make it full screen

And now image occlusion masks are very blurry. It is almost as if they were resized and turned into a picture at the small size and then just scaled up without any resolution increase. A similiar effect happens in the card preview windows.

I also wanted to ask, is this the right place to report bugs or the github in the issues section?

1 Like

Can reproduce. For reference, the following is the code which needs to be changed in the card templates to make the borders thicker:

--inactive-shape-border: 10px #212121;
--active-shape-border: 10px #212121;

This forum is the right place, although github is accepted too, as far as I know.

1 Like

Yes, the this is the right place. Not all issues are bugs, so we can triage them here, and keep Github reserved for developers.