G
G
garrykillian2011-01-10 17:37:52
inkscape
garrykillian, 2011-01-10 17:37:52

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

3 answer(s)
M
Maxim Ponomarev, 2011-05-17
@maxvipon

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:
millimeters
Pixels are fractional
Pixels

R
Riateche, 2011-01-11
@Riateche

Draw in 1/10 scale. And then when exporting, specify rounding to one decimal place.

C
crantisz, 2017-05-23
@crantisz

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 question

Ask a Question

731 491 924 answers to any question