Answer the question
In order to leave comments, you need to log in
How to make in InkScape that in the svg file all points of the object have integer coordinates?
Usually, the path coordinates in SVG look like this: <M 240.123,172.75 490.01,12.67 z>
The task is to make them look like: <M 240.172 490.12 z>
Illustrator, when exporting to SVG, suggests specifying the number of characters after comma, but it has at least 1 sign.
Manually editing the coordinates is not an option.
Answer the question
In order to leave comments, you need to log in
All coordinates depend on the canvas and grid settings. If we specify the size in millimeters / centimeters in the canvas settings, the coordinates will still be in pixels (because the default grid is in pixels). Notice that the top left edge of the document doesn't line up with the grid:
Let's resize the document to pixels and see that it's a fractional number:
Now remove the fraction from the document size and get beauty:
Draw in 1/10 scale. And then when exporting, specify rounding to one decimal place.
There is a special SVGO library in the world that optimizes SVG. There is also an online service based on it: https://jakearchibald.github.io/svgomg/. It removes unnecessary tags created by inkscape, shortens the text and can also round values - the Precision slider. The slider is limited to 1 decimal place, but nothing prevents you from opening the developer tools and changing the slider limit to 0.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question