Home > Net >  SVG pixelate when using with canvas in full window height and width for all devices
SVG pixelate when using with canvas in full window height and width for all devices

Time:08-03

I'm using Jspain library in this project. enter image description here

If you then try to flood fill those bitmap shapes with a colour, those grey edge pixels are going to appear like white lines or spots around the edge of the fill.

There are a few things you can do. For example:

  1. You can disable anti-aliasing in your SVG images. Use shape-rendering="crispEdges" as a property or CSS style. See: https://www.w3.org/TR/SVG11/single-page.html#painting-ShapeRenderingProperty

  2. Render the SVG. Then run a threshhold or contrast filter over that image to remove the grey pixels.

  • Related