Snapping nodes creates a 1px line in between.

Post questions on how to use or achieve an effect in Inkscape.
rpack
Posts: 3
Joined: Tue Dec 13, 2016 12:19 pm

Snapping nodes creates a 1px line in between.

Postby rpack » Tue Dec 13, 2016 12:26 pm

Imagine I'm making two rectangles, one blue and one red. And I want them to meet. So I use the nodes menu and the drag the corner of one rectangle to snap to the corner of the other rectangle. Then I'll do the same with the other corner. At first it looks like the shapes is seamed together. But at a closer look there's a 1px line of background between them. If I for example put a green box behind them, it shines through tiny bit between the rectangles. Why is this?

User avatar
Xav
Posts: 1209
Joined: Fri May 08, 2009 1:18 am
Location: UK
Contact:

Re: Snapping nodes creates a 1px line in between.

Postby Xav » Tue Dec 13, 2016 6:25 pm

It's probably due to "anti-aliasing" - which just means that, if the shapes Inkscape draws don't lie exactly on the pixel boundaries of the output device, it compensates by drawing the outer pixels slightly transparent. Imagine a line drawn at an angle - if Inkscape draws a "hard" colour in each pixel it crosses, you'll see a stepped shape; so instead it anti-aliases it by drawing pixels whose transparency corresponds to the amount of the line that crosses into each cell.

Since 0.91 you can turn off anti-aliasing in the document properties dialog.

If you search the forum you'll find lots of similar questions (and answers), which may help you to manage the issue in other ways.
Co-creator of The Greys and Monsters, Inked - Inkscape drawn webcomics
Web SiteFacebookTwitter

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Snapping nodes creates a 1px line in between.

Postby Lazur » Tue Dec 13, 2016 9:00 pm

Because anti-aliasing means you will have semi-transparent "subpixels", the edges fading to 0 opacity, AND
that those pixels are composited as they were simply put one atop another instead of
compositing the alpha values to full opaque pixels.

Like it can be achieved to composite the objects together without any rendering gaps in between, although there is not an automated method to pull it off nor would it convert well to a printable pdf so I suggest overlapping the objects whenever possible.
These images were made that way.
Check this one in inkscape how objects are arranged for the concept.

rpack
Posts: 3
Joined: Tue Dec 13, 2016 12:19 pm

Re: Snapping nodes creates a 1px line in between.

Postby rpack » Wed Dec 14, 2016 7:35 am

Thanks! Found more information now that I know what to search for! Is this seen as a problem by professionals in vector graphics? It seems like much extra work to extend all the objects behind further when its convenient to just snap them to get them exactly right. Tried it but found it hard to get all the angles and other stuff perfect.

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Snapping nodes creates a 1px line in between.

Postby Lazur » Wed Dec 14, 2016 8:46 am

My guess would be a simple "additive alpha" "compositing group mode" could solve it. As that filtered example shows above, how it can be simulated manually.
Although the problem is general with anti-aliasing, I know no such developed solution.
Inkscape relies on svg, and as svg 2's development takes so long the workgroup doesn't seems very innovative. Still better than eps and pdf which has no support for filters&blending modes.


But don't worry, an 1 px gap is not noticeable at a reasonably high resolution ie. when printed.

rpack
Posts: 3
Joined: Tue Dec 13, 2016 12:19 pm

Re: Snapping nodes creates a 1px line in between.

Postby rpack » Wed Dec 14, 2016 9:56 am

Lazur wrote:But don't worry, an 1 px gap is not noticeable at a reasonably high resolution ie. when printed.

Thanks for your answers!

As a photographer och mainly using Photoshop I've become way to much of a pixel peeper :D


Return to “Help with using Inkscape”