How Do I Remove Those Annoying White Lines?

Post questions on how to use or achieve an effect in Inkscape.
amiatrome
Posts: 5
Joined: Mon Mar 24, 2008 10:54 pm

How Do I Remove Those Annoying White Lines?

Postby amiatrome » Tue Mar 25, 2008 1:06 am

Hi all, I am getting white lines in my images when I use Inkscape. I did a quick search for "white line" but no luck.

When I use VectorMagic to convert my jpeg to a svg or png, the results are ok.
Image

However, when I open the VectorMagic svg in Inkscape (need to resize it), I get addtional white lines. I also get the white lines when I convert my jpeg to svg using Inkscape directly, which was why I turned to VectorMagic.
Image

How do I remove the white lines using Inkscape? Thanks.

User avatar
sas
Posts: 404
Joined: Sat Oct 06, 2007 5:42 am

Re: How Do I Remove Those Annoying White Lines?

Postby sas » Tue Mar 25, 2008 1:59 am

amiatrome wrote:When I use VectorMagic to convert my jpeg to a svg or png, the results are ok.

When you say the SVG is OK, what are you viewing it with? If you make your changes in Inkscape, does the changed SVG look OK in your SVG viewer?

(need to resize it)

Can't you do that by adjusting the width, height and viewBox? I wouldn't want to edit an SVG in Inkscape just to resize it.

Your problem sounds like bug 170356, but it's hard to be sure without examining the SVG file.

User avatar
aho
Posts: 180
Joined: Sun Nov 04, 2007 9:51 am
Contact:

Re: How Do I Remove Those Annoying White Lines?

Postby aho » Tue Mar 25, 2008 2:27 am

What you are seeing there are seams, which are produced by the renderer if there are "touching" areas.

Say there are two black rectangles... the left one stops at 5.5 and the right one starts at 5.5. Mathematically there shouldn't be a seam visible, right? However, Inkscape renders each shape on its own. So, when it renders the left one the column at 6 gets blended over with black with an opacity of 50%. And when it renders the right one the column at 6 gets again blended over with black with an opacity of 50%. What we now get isn't a fully opaque black - we get black with 75% opacity.

And well... that's basically the problem.

It can be solved by making things overlap or if you always hit the pixel boundaries (and export at a specific size).

Right. Fixing that image is quite easy over in a pixel based drawing program.

-open the file
-duplicate the layer
-run the median filter (with a radius of 2) over the lower one

And that's it.

edit: oh and it's probably a good idea to redo the gradient background thingy manually. Looks sorta bad the way it is.

amiatrome
Posts: 5
Joined: Mon Mar 24, 2008 10:54 pm

Re: How Do I Remove Those Annoying White Lines?

Postby amiatrome » Tue Mar 25, 2008 2:31 am

sas wrote:
amiatrome wrote:When I use VectorMagic to convert my jpeg to a svg or png, the results are ok.

When you say the SVG is OK, what are you viewing it with? If you make your changes in Inkscape, does the changed SVG look OK in your SVG viewer?


When editing within VectorMagic online and opening the png downloaded from VectorMagic, there are no lines. When I open the svg downloaded from VectorMagic in Inkscape, the lines appear.

Can't you do that by adjusting the width, height and viewBox? I wouldn't want to edit an SVG in Inkscape just to resize it.


I am intending to resize it and export to png, print out the image (300dpi) on paper and apply it as a design to my 150 x 75 cm plain table, subsequently coating it. But to be honest, I haven't tried that on the VectorMagic website.

Your problem sounds like bug 170356, but it's hard to be sure without examining the SVG file.


I have uploaded the svg file to mediafire http://www.mediafire.com/?zt0wlstnmgf. Thanks.

amiatrome
Posts: 5
Joined: Mon Mar 24, 2008 10:54 pm

Re: How Do I Remove Those Annoying White Lines?

Postby amiatrome » Tue Mar 25, 2008 2:44 am

By the way, it's not so apparent but the white line problem exists throughout the Inkscape image, even on the face etc. eg. look at the hair just above the forehead. :D

User avatar
prkos
Posts: 1625
Joined: Tue Nov 06, 2007 8:45 am
Location: Croatia

Re: How Do I Remove Those Annoying White Lines?

Postby prkos » Tue Mar 25, 2008 3:26 am

What kind of a trace are you using? Maybe you could use some other option that wouldn't produce those lines.
just hand over the chocolate and nobody gets hurt

Inkscape Manual on Floss
Inkscape FAQ
very comprehensive Inkscape guide
Inkscape 0.48 Illustrator's Cookbook - 109 recipes to learn and explore Inkscape - with SVG examples to download

User avatar
sas
Posts: 404
Joined: Sat Oct 06, 2007 5:42 am

Re: How Do I Remove Those Annoying White Lines?

Postby sas » Tue Mar 25, 2008 3:36 am

Your SVG file is too large for me (I need more RAM), but having examined the PNG again, I'm sure it is bug 170356 (which is what aho was talking about too). This bug isn't specific to Inkscape - it afflicts every SVG renderer I know of, because they all work in the way that aho describes.

Anyway, as your image shouldn't have any transparency, you can fix the PNG made by Inkscape just by removing the alpha channel. For example, pngcrush can do this (pngcrush -c 2 infile.png outfile.png). For images with transparency, aho's method sounds pretty neat, though I haven't tried it.

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

Re: How Do I Remove Those Annoying White Lines?

Postby capnhud » Tue Mar 25, 2008 4:42 am

Ok the good news is that this can be fixed. First of all your 3227 objects all seem to contain a stroke, which is causing the gap. What I did was grabbed one of the objects and then removed the .17 stroke it had and then grabbed an adjacent object and removed its stroke and then did path union and the gap (white line disappeared) it will take some time and effort on your part, but this could be fixed albeit very slowly. Because of the the number of objects you will need to keep changing your view mode to outline. (Shortcut the number 5 in the number pad

The bad news is you will need to write down the colors because when you do a union the objects will become the same color thus you will lose some of the gradient effect unless you know what the colors are.

When you have a file this big save as inkscape svgz. The difference is that it goes from 1.7mb to 411kb much easier to open.

User avatar
sas
Posts: 404
Joined: Sat Oct 06, 2007 5:42 am

Re: How Do I Remove Those Annoying White Lines?

Postby sas » Tue Mar 25, 2008 8:05 am

capnhud wrote:First of all your 3227 objects all seem to contain a stroke, which is causing the gap.

Well spotted. But the strokes aren't causing the gaps - in fact, the purpose of the strokes is to close the gaps. It only works at high resolution though: the gaps are the same width at all resolutions (since they are merely rendering artifacts), but the strokes obviously get wider at higher resolutions, and eventually become wide enough to cover the gaps. (With some effort, I managed to load the huge SVG file in Inkscape and zoom to 1000%. There are no white lines at this zoom level. Similarly, all the white lines disappear in the Adobe SVG Viewer at maximum zoom.)

SVG 1.2 is expected to have non-scaling strokes, which will allow this sort of trick to work at all resolutions.

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

Re: How Do I Remove Those Annoying White Lines?

Postby microUgly » Tue Mar 25, 2008 10:28 am

This won't be a great solution for file such as this one which is already so large, but if you grouped the entire picture (it may already be grouped), duplicated it then move the duplicate one pixel this should make the gaps invisible since they'll look through to the underlying image rather than the white canvas. It's not sexy but it should work.

Also, since all the objects have a stroke, can you select all the objects and simply increase the stroke a fraction to force them to overlap?

amiatrome
Posts: 5
Joined: Mon Mar 24, 2008 10:54 pm

Re: How Do I Remove Those Annoying White Lines?

Postby amiatrome » Tue Mar 25, 2008 11:17 am

Many thanks for the helpful replies guys. I tried out aho's solution and it worked. I haven't tried out the other methods though because I have got a new problem.

I mentioned above I was planning to get a 300dpi image to apply to a 65inch long table. I tried scaling width to 19500px, then exporting to png at 300dpi.

I am doing this on an iMac with 1GB + 256 MB RAM. I woke up this morning and it still wasn't done. 3 hrs. Yeah. I slept so little. Poor me. :lol: I clicked on Inkscape and the exporting progress dialog disappeared. Clicking on the main window made it drop to background behind other windows instead. So I ended the program. I checked the png file and it was partially done.

Is there a better way for me to export this file, keeping in mind my eventual goal? Thanks! :P

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

Re: How Do I Remove Those Annoying White Lines?

Postby microUgly » Tue Mar 25, 2008 12:47 pm

There is really only one way. I believe export will be faster in 0.46.

User avatar
aho
Posts: 180
Joined: Sun Nov 04, 2007 9:51 am
Contact:

Re: How Do I Remove Those Annoying White Lines?

Postby aho » Tue Mar 25, 2008 8:43 pm

Ye, PNG export was slightly bugged in 0.45. See:

http://kaioa.com/node/30

Alex

How Do I Remove Those Annoying White Lines?

Postby Alex » Wed Mar 31, 2010 12:09 am

I think the problem is actually with vctor magic, cuz im having the exact same problem going from vector magic to tiler, if I open it in preview it is fine, but once i do tiler i get those fucking white lines. Have you figured it out?

Alex

Re: How Do I Remove Those Annoying White Lines?

Postby Alex » Wed Mar 31, 2010 12:23 am

Also here is A visual for you

Image


User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: How Do I Remove Those Annoying White Lines?

Postby druban » Wed Mar 31, 2010 7:17 pm

To Alex! i am not seeing the white lines in the image you posted could you tell me what I am looking for, like in what area etc. Maybe I see something in the area between the right arm and shoulder where the fabric looks like it has a white edge is that it?
Your mind is what you think it is.

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

Re: How Do I Remove Those Annoying White Lines?

Postby microUgly » Wed Mar 31, 2010 8:32 pm

druban wrote:To Alex! i am not seeing the white lines in the image you posted could you tell me what I am looking for, like in what area etc. Maybe I see something in the area between the right arm and shoulder where the fabric looks like it has a white edge is that it?

Because the image has been scaled down, the white lines aren't as obvious. But they are slight gaps between each block of colours. This is a clearer example of the effect I'm pretty sure Alex is describing - http://www.visit.me.cz/inkscape/sunset.png

User avatar
RobA
Posts: 335
Joined: Fri Aug 10, 2007 1:22 am

Re: How Do I Remove Those Annoying White Lines?

Postby RobA » Thu Apr 01, 2010 4:19 am

The lines between all the colours really aren't there, they are just rendering artifacts. No matter how much you zoom they do not get larger. I noticed all the shapes created by tracing have no strokes. I though a way to get rid of the gaps would be to overlap the shape by giving them strokes the same colour as the fill.

I wrote an extension to copy the fill to the stroke (attached). You can take the result of the trace, ungroup it, then run Extensions->Modify path-> Set Stroke Colour from Fill... and specify the width you want the stroke to be.

It will only set the stroke colour if there is already not a stroke.

-Rob A>
Attachments
fill2stroke.zip
extension to copy the fill to the stroke and let you set the width of the stroke.
(1.93 KiB) Downloaded 301 times

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: How Do I Remove Those Annoying White Lines?

Postby druban » Thu Apr 01, 2010 5:02 am

Is this effect only on autotraced files? i have not noticed it on my handdrawn work and I do not usually use full colour traces. Although i might need to sometime.
Your mind is what you think it is.

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

Re: How Do I Remove Those Annoying White Lines?

Postby microUgly » Thu Apr 01, 2010 7:10 am

I though a way to get rid of the gaps would be to overlap the shape by giving them strokes the same colour as the fill.

Another way I suggested in the linked post above is to offset all objects by a few pixels.
druban wrote:Is this effect only on autotraced files?

Yes, it's only on auto-traced files. And if you are auto-tracing with Inkscapes built in feature, you can select "stack scan" to avoid the effect.

digidimi

Re: How Do I Remove Those Annoying White Lines?

Postby digidimi » Mon Aug 23, 2010 10:27 am

microUgly wrote:This won't be a great solution for file such as this one which is already so large, but if you grouped the entire picture (it may already be grouped), duplicated it then move the duplicate one pixel this should make the gaps invisible since they'll look through to the underlying image rather than the white canvas. It's not sexy but it should work.

Also, since all the objects have a stroke, can you select all the objects and simply increase the stroke a fraction to force them to overlap?

THANKS, works perfectly!

sarf72
Posts: 1
Joined: Tue Sep 27, 2016 3:06 am

Re: How Do I Remove Those Annoying White Lines?

Postby sarf72 » Tue Sep 27, 2016 3:21 am

Go to Vector Magic Export Option

Set these settings:

Shape Mode : Shape Place in cut-outs in shapes below
Stroking Mode: Stroke shape boundaries
DXF mode: Lines Only, Convert splines to more lines (larger file)

That's all. Enjoy!!! :ugeek:


Return to “Help with using Inkscape”