Background color of SVG changed after sketch effect applied

Post questions on how to use or achieve an effect in Inkscape.
quartaela
Posts: 4
Joined: Sat Apr 27, 2013 3:07 am

Background color of SVG changed after sketch effect applied

Postby quartaela » Sat Apr 27, 2013 3:21 am

Hi there. I'm dealing with my final project and i decided to use SVG file for my game's map. Moreover, i want to add sketch effect to every SVG node. However, when i apply a sketch effect to a node background color changes interestingly that i cannot understand. Even though, when i cancel "Fill" option from "Fill and Stroke" tab this background color remains when i import this file for using it in JavaFX. I took some snapshots to make it clear.

Here is SVG node before i apply a sketch effect.

Image

and after i apply a sketch effect

Image

I hope i had been clear to you and i will appreciate for every answer. Thanks anyway

EDIT: you can find SVG file in attachment part.
Attachments
Risk3.svg
(121.74 KiB) Downloaded 162 times

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

Re: Background color of SVG changed after sketch effect appl

Postby brynn » Sat Apr 27, 2013 9:35 am

Image
Welcome to InkscapeForum!

Well, twice I've had a reply ready to post, but when I post it, the message is gone! (Not your fault, it's part of our spam prevention -- when you edit the msg, it has to be approved again.)

When the sketch effect is applied, it looks like the original closed path is exchanged for the several open paths which comprise the effect. Paths which are not closed can't be filled completely. Any concave areas will accept the fill, or the other side of convex areas. But to have a complete fill, you need a closed path.

One good solution in this case, might be to duplicate the object and apply the effect to the duplicate. Leave the original close path filled, but remove the fill from the duplicate after you apply the effect.

There may well be other solutions to this, but that's what I would try 1st :D

quartaela
Posts: 4
Joined: Sat Apr 27, 2013 3:07 am

Re: Background color of SVG changed after sketch effect appl

Postby quartaela » Sat Apr 27, 2013 9:52 am

finally! :D no problem about spam prevention however, waiting someone to accept the new thread wastes a little bit time :). So you say if i duplicate the node it will put upon on the old one (not replace) ? Moreover, i'm considering to change background color while game is played. I understood your solution however, when i try to draw a simple rectangle and give the sketch effect everything work perfect (so i guess paths of it are completely closed) and i can even change the background color without any corruption. Are there any ways to close paths properly ?

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

Re: Background color of SVG changed after sketch effect appl

Postby Lazur » Sat Apr 27, 2013 11:12 am

I have no idea what do you mean by "properly", but there is an extension for closing paths.
http://www.cnc-club.ru/forum/viewtopic.php?f=15&t=37&p=92
-although I still haven't tried it yet.

quartaela
Posts: 4
Joined: Sat Apr 27, 2013 3:07 am

Re: Background color of SVG changed after sketch effect appl

Postby quartaela » Sun Apr 28, 2013 2:40 am

i tried but it didn't work. I hope you understood my issue. However, i can discribe again.

1) download the .svg file which i uploaded
2) select a SVG node
3) apply "sketch" effect from Path->Path Effect Editor
4) you will see that background color distribution changes

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

Re: Background color of SVG changed after sketch effect appl

Postby brynn » Sun Apr 28, 2013 3:17 am

Yes, I understand the problem and I can reproduce it.

You can't have a solid color fill inside an object to which the Sketch LPE has been applied. The only way to do it, that I know of, is to duplicate the object before you apply the LPE Sketch. After that, select only the duplicate, remove its fill, and apply the the Sketch effect. The original object, which does not have the sketch effect, holds the color fill, while the duplicate on top displays the sketch effect, and has no fill color.

In steps:
1 - select object
2 - duplicate
3 - remove fill
4 - apply sketch effect

quartaela
Posts: 4
Joined: Sat Apr 27, 2013 3:07 am

Re: Background color of SVG changed after sketch effect appl

Postby quartaela » Sun Apr 28, 2013 7:02 am

Yeah i got it finally!! thanks for your help. On the other hand could i ask another question ?

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

Re: Background color of SVG changed after sketch effect appl

Postby brynn » Mon Apr 29, 2013 7:07 pm

You're welcome Image

Of course you can ask another question! If it's related to this problem, or the file you attached, just post another reply. But if it's something else, please start a new topic :D


Return to “Help with using Inkscape”