How to align filled objects to even gridlines

General discussions about Inkscape.
User avatar
capnhud
Posts: 435
Joined: Mon Jun 04, 2007 8:30 pm
Location: U.S.A

How to align filled objects to even gridlines

Postby capnhud » Sat Nov 17, 2007 12:53 am

In the inkscape tips and tricks it mentions that
Suppose you want to create a 24x24 pixel icon. Create a 24x24 px canvas (use the Document Preferences) and set the grid to 0.5 px (48x48 gridlines). Now, if you align filled objects to even gridlines, and stroked objects to odd gridlines with the stroke width in px being an even number, and export it at the default 90dpi (so that 1 px becomes 1 bitmap pixel), you get a crisp bitmap image without unneeded antialiasing.


I get the part about setting up the grid to .5, but I am drawing a blank when it says to align filled objects to an even number and stroke to an odd number. Is there an example of this somewhere?

User avatar
microUgly
Site Admin
Posts: 2985
Joined: Sat Jun 02, 2007 3:13 pm
Contact:

Re: How to align filled objects to even gridlines

Postby microUgly » Mon Nov 19, 2007 9:19 am

Below is a 5 pixel square with a 1 pixel stroke
Image

Notice the position of the stroke? It overlaps the fill by half a pixel. This is why you need to snap to odd or even depending on if you're using stroke or not. Stroke will add an extra half of the stroke width to the size to your object.

User avatar
capnhud
Posts: 435
Joined: Mon Jun 04, 2007 8:30 pm
Location: U.S.A

Re: How to align filled objects to even gridlines

Postby capnhud » Tue Nov 20, 2007 11:02 pm

If only there was an option to snap to odd or even.

User avatar
microUgly
Site Admin
Posts: 2985
Joined: Sat Jun 02, 2007 3:13 pm
Contact:

Re: How to align filled objects to even gridlines

Postby microUgly » Wed Nov 21, 2007 8:33 am

capnhud wrote:If only there was an option to snap to odd or even.

A better option would be to control the position of stroke (i.e. outside, inside, middle) like most software allows, but it doesn't seem this flexibility was included in the SVG standard.

Simarilius
Posts: 626
Joined: Wed Jun 06, 2007 2:37 am

Re: How to align filled objects to even gridlines

Postby Simarilius » Wed Nov 21, 2007 9:01 am

Just set snap to bounding box rather than nodes and reposition it.

User avatar
capnhud
Posts: 435
Joined: Mon Jun 04, 2007 8:30 pm
Location: U.S.A

Re: How to align filled objects to even gridlines

Postby capnhud » Wed Nov 21, 2007 8:41 pm

A better option would be to control the position of stroke (i.e. outside, inside, middle)


Now that would help alot. It wasn't until I tried lettering that I soon discovered that when a stroke is added to an object part of it is inside of the object taking up some of the original dimension.


Return to “General Discussions”