关闭 SVG 图像中嵌入的位图图像的抗锯齿

Turn off anti-aliasing of bitmap images embedded in SVG images

我在 SVG 图像中嵌入了 PNG 图像。如何关闭嵌入图像的抗锯齿功能? (或者,为包括嵌入图像在内的所有内容关闭它?)

我已经尝试在图像对象上设置 shape-rendering="crispEdges",但是当我使用 Chrome 或 Inkscape 放大时,我仍然可以看到模糊的边缘。

谢谢

shape-rendering 适用于形状,即直线和圆形。图片有自己的 属性 image-rendering。你需要这样的东西...

    image-rendering: -moz-crisp-edges;
    image-rendering: pixelated;