And it seems like a solution to excessive aliasing (in the sense of a dark thin line rendering as a not-so-dark double-wide line) could be to round the desired size down to the nearest known-good size and pad the edges with negative space.
A single good SVG can obviate your small raster images and the 2x and 3x versions you might need for HiDPI screens. You can also get automatic handling of dark mode with no changes to your page's CSS.
There's work involved but the flexibility is pretty awesome.
In addition, vector-effect="non-scaling-stroke" allows you do declare that a line is [eg] 1px thick, regardless of the image size.
Snapping to sizes would be possible, but not straightforward, until CSS supports calc(round()) https://www.w3.org/TR/css-values-4/#round-func
When I walk into a hardware store planning to appropriate some part for a different purpose than intended, my first question is "who has this problem?"
I've been exploring mind-mapping software. It's astonishing how primitive the namespace handling can be. Shades of the flat file system from a 1984 Macintosh (mine had an early serial number). Same question: Who understands this issue? Programming language designers. Everyone else is just guessing.
Fonts change design at different scales.