Inkscape makes very small rendering errors that can, in certain situations, look really bad in your final raster of an SVG. They occur when the edges of two shapes coincide - a common occurrence when you have stacked duplicates.
For example, look at this image. This consists of a black background with a white square and a duplicate black square on top of it.
Notice that a faint white line is visible! This is technically a rendering error - the black square is a duplicate so it completely obscures the white square. No white should be visible at all! In fact, this error is infinitesimal - no matter what resolution you export at and no matter how much you zoom in in Inkscape, that white line will have the same thickness.
But there is any easy workaround for this because the errors are infinitesimal. Simply export it at several times your desired image size and then use a program like Paint.NET/Photoshop/Gimp/Irfanview to resize the image back down to the size you want.
Voila!
Note:If you look closely, you'll notice that the white lines are still faintly visible in this final image. I don't think it's possible to truly remove them, but the larger you export before resizing, the fainter they will appear afterwards. This was about 10x, but in my experience 4-5x is usually enough to make it look presentable.
Workaround for Rastering Errors
Re: Workaround for Rastering Errors
Simply export it at several times your desired image size and then use a program like Paint.NET/Photoshop/Gimp/Irfanview to resize the image back down to the size you want.
But don't you get some pixelation issues from scaling it down so much? I mean to me, the whole reason I want to use Inkscape/vector graphics is so I can scale things without any distortion, like happens when you scale raster graphics.
I haven't used the new Inkscape eraser tool (new in 0.47), so I don't know for sure. But maybe that's a good answer to the problem you describe?
Basics - Help menu > Tutorials
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Re: Workaround for Rastering Errors
why can't you just delete the white square -or assign it no fill no stroke?
Your mind is what you think it is.
Re: Workaround for Rastering Errors
brynn wrote:But don't you get some pixelation issues from scaling it down so much?
Scaling down raster graphics isn't much of a problem (unlike scaling up), as long as a decent algorithm is used.
I haven't used the new Inkscape eraser tool (new in 0.47), so I don't know for sure. But maybe that's a good answer to the problem you describe?
It's best to change the SVG file to avoid the problem if possible, and the eraser tool might be a way to do that in some cases. But in many cases there's no easy way to fix the SVG file, and the method that silverhammermba describes is useful in those cases.
The real fix would be a completely different rendering method. It would be slow, so it wouldn't be suitable for on-screen rendering, but it could be an option for bitmap export.
druban wrote:why can't you just delete the white square -or assign it no fill no stroke?
That would work in this particular case, but real cases are not usually so easy to deal with.
-
- Posts: 3
- Joined: Wed Jan 06, 2010 1:53 am
Re: Workaround for Rastering Errors
druban wrote:why can't you just delete the white square -or assign it no fill no stroke?
Yeah, my OP was a somewhat trivial example, but imagine if instead the black square were a gradient from opaque to transparent. Then the opaque edge would have the faint white line around it. You could fix it by slightly moving the edge of the white square so that it doesn't coincide with the edge above it, but that could produce an obvious gap at larger resolutions.