How to set the default measuring unit for objects to pixels?

Post questions on how to use or achieve an effect in Inkscape.
zenchip
Posts: 2
Joined: Tue Aug 01, 2017 8:22 am

How to set the default measuring unit for objects to pixels?

Postby zenchip » Tue Aug 01, 2017 8:39 am

Hello everyone,

First of all, Inkscape is such an super-awesome tool, thanks for creating it!

I am drawing a few objects and I want to work with pixels only. I select an object and I chose "px" instead of "mm" for setting it's dimensions.
But many times I do something, the measuring unit for objects (X, Y, W, H - in the top toolbar of the "Select and transform objects") is getting back to millimeters.

Is it possible to set the default unit to pixels so it stays in pixels forever?
If not, then I would like to ask for a feature request to implement this option.

Thanks

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: How to set the default measuring unit for objects to pixels?

Postby brynn » Tue Aug 01, 2017 6:11 pm

Document Properties > Page tab > Display Units

Note, that's the first setting on the page. If you change the units for the page size further down, it won't work. You must change Display Units. (Although you might want the page size to be pixels as well. That's fine, but changing it alone won't fix your current problem.)

After you change Display units to px, look about halfway down the same page for Scale Factor. Make sure it's set to 1.0.

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: How to set the default measuring unit for objects to pixels?

Postby tylerdurden » Tue Aug 01, 2017 9:11 pm

You can make Inkscape always launch new documents with your preferred units and page size:

Setup your document with display units px and page units to px and scale=1. Set your page size if you like. Then, save the file as "default.svg" (no quotes) to your user profile:

In Windows:
..\users\username\appData\Roaming\Inkscape\templates\

NB: (appData) may be a hidden folder.
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

zenchip
Posts: 2
Joined: Tue Aug 01, 2017 8:22 am

Re: How to set the default measuring unit for objects to pixels?

Postby zenchip » Thu Aug 03, 2017 2:05 am

brynn wrote:Document Properties > Page tab > Display Units

Note, that's the first setting on the page. If you change the units for the page size further down, it won't work. You must change Display Units. (Although you might want the page size to be pixels as well. That's fine, but changing it alone won't fix your current problem.)
Thanks, I wasn't aware of the "Display units" at the top of the window, it works now

After you change Display units to px, look about halfway down the same page for Scale Factor. Make sure it's set to 1.0.
My document is a 200px x 200px and it contains a circle sized 150x150 px. The scale factor was 1.00000 but once I changed the Display units from "mm" to "px", the Scale changed to 0.26458
Then I changed the Scale to 1 and my circle was resized from 150px to 39px (39.688px in fact). Why is that? This is not an issue, I resized the circle, it's just that curious thinkers want to know

Thanks!

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: How to set the default measuring unit for objects to pixels?

Postby tylerdurden » Thu Aug 03, 2017 10:49 am

zenchip wrote:... The scale factor was 1.00000 but once I changed the Display units from "mm" to "px", the Scale changed to 0.26458
Then I changed the Scale to 1 and my circle was resized from 150px to 39px (39.688px in fact). Why is that? This is not an issue, I resized the circle, it's just that curious thinkers want to know...

Some info here:
http://wiki.inkscape.org/wiki/index.php ... n_Inkscape
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: How to set the default measuring unit for objects to pixels?

Postby brynn » Thu Aug 03, 2017 12:07 pm

I can't explain why, and I don't understand everything in the wiki article TD provided. But scale factor of 1 means that you're always working at a 1 to 1 scale, relative to your screen resolution.

Starting with version 0.92, Inkscape is apparently using mm as its default unit. So if you change it to something else, like px, the scale changes. But it's still relative to mm. Changing the scale factor to 1 makes it relative to your screen resolution. That's my feeble understanding. It probably isn't technically correct.

If what you're doing isn't technical, or you don't need precise real units, it probably doesn't matter. I would set the Scale Factor to 1 and not touch it again. But if you're working on something that must be precisely some certain size (like for digital cutting machines or printing a technical document), then you'll need to learn about all that stuff, so you can set up Inkscape properly.


Return to “Help with using Inkscape”