Problem with Tracing bitmap

Post questions on how to use or achieve an effect in Inkscape.
Pony-Berserker
Posts: 19
Joined: Sun Dec 16, 2012 9:31 am

Problem with Tracing bitmap

Postby Pony-Berserker » Sun Dec 16, 2012 9:36 am

First of all, I'm new to Inkscape, but I watched a few tutorials.

So, I tried to create a vector with tracing bitmap tool. Nearly everything went great but one thing - the tool made white parts in graphic disappear (I wanted to delete background only). The graphic was already "backgroundless" and I have no idea what I'm doing wrong.

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

Re: Problem with Tracing bitmap

Postby brynn » Sun Dec 16, 2012 8:40 pm

Image
Welcome to InkscapeForum!

I'm not entirely clear about the situation. You said you wanted to remove the background. But then you said the image had no background (the background is transparent). So that's a little confusing.

Can you show us the image? A screenshot should be fine. Or if you don't want to show it, just clarify about the background/no background thing. And also, what settings did you use for Trace Bitmap. It sounds like you might have used the SIOX Foreground technique -- to remove the background....but then you said it had no background. So maybe you did some other kind of trace?

Pony-Berserker
Posts: 19
Joined: Sun Dec 16, 2012 9:31 am

Re: Problem with Tracing bitmap

Postby Pony-Berserker » Mon Dec 17, 2012 3:10 am

brynn wrote:Image
Welcome to InkscapeForum!

I'm not entirely clear about the situation. You said you wanted to remove the background. But then you said the image had no background (the background is transparent). So that's a little confusing.

Can you show us the image? A screenshot should be fine. Or if you don't want to show it, just clarify about the background/no background thing. And also, what settings did you use for Trace Bitmap. It sounds like you might have used the SIOX Foreground technique -- to remove the background....but then you said it had no background. So maybe you did some other kind of trace?


Well, it's confusing me as well - I removed the background in GIMP - "transparent background". Then I exported it; opened in Inkscape. I didn't use SIOX Foreground technique. With "remove background on" it removed everything white from the picture. With "remove background" off, the picture appeared to have a background around it - even if it had no background before...
I'd provide the pictures, but I deleted them :P It was just a practice. But if you want to know which graphic I used - look at this http://arch.413chan.net/Twilight_Sparkle_is_smug-(n1299468485642).jpg - the white part of eyes were removed in Inkscape - I used in Inkscape only the character with no background.

I've seen on YT how to do it, but the woman there had a simple black and white picture of a wing, so... maybe it's a wrong method? How am I supposed to do this? :/

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

Re: Problem with Tracing bitmap

Postby brynn » Mon Dec 17, 2012 10:14 pm

I'd provide the pictures, but I deleted them :P It was just a practice.

Aaahh, well we are getting into some uncertain territory here, speaking hypothetically for images which no longer exist!

But I think PT is probably on to the issue. If you can't make it work using his/her :?: comments, please let us see the image you are using, even if it is a practice image :D

Pony-Berserker
Posts: 19
Joined: Sun Dec 16, 2012 9:31 am

Re: Problem with Tracing bitmap

Postby Pony-Berserker » Tue Dec 18, 2012 7:05 am

brynn wrote:
I'd provide the pictures, but I deleted them :P It was just a practice.

Aaahh, well we are getting into some uncertain territory here, speaking hypothetically for images which no longer exist!

But I think PT is probably on to the issue. If you can't make it work using his/her :?: comments, please let us see the image you are using, even if it is a practice image :D



http://www.sendspace.pl/file/pic/c01244 ... b0c30/view

So, I chose another similar picture, removed the background etc.

With 12 scans, there was no white parts of the eye at all. With 50 - there were some holes as you can see in the picture I linked.

But with the picture you used, the eyes were removed even at 80 scans (you used it with the background).

Isn't there a way to stop Inkscape from removing the white parts other than making 80 scans? ;)

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

Re: Problem with Tracing bitmap

Postby brynn » Tue Dec 18, 2012 12:33 pm

"PT is a he" -- awesome, just want to be sure. thanks!

Hhmmm.....ok, let's organize the info:

1 - remove background with GIMP
2 - exported
3 - opened in Inkscape
4a - trace with Remove background checked - results in all white being removed
4b - trace with Remove background not checked - result looked like it had a background, even though it didn't have one to begin with.

Questions:
2 - exported to what file format/file type -- JPG, GIF, PNG?
3 - If it was exported, or saved in any raster format, it would have had to be imported into Inkscape. Is that what happened? You didn't happen to paste it into Inkscape did you?

In your screenshot, what are we seeing there? The top purple pony, is that the result of the work in GIMP? That's what you imported into Inkscape?

Then below the top pony, we see 2 ponies against a red background or red rectangle. Are both of those ponies from the same trace? Or is one a trace with background, and the other a trace without? If that's the case, then neither one of the trace results contains a background (or iow, background is transparent) otherwise we would not see the red behind it. Or otherwise, if you could explain the screenshot, so we know what we're looking at?

There are some things about your screenshot that are confusing. Like in the top area of the top pony, we can see the page border behind the image, so we know that the background is transparent. But right between the top pony and the red rectangle is a portion of a vertical black line. And something that is covering up the page border.. I can't figure out what that is?

If you could either upload the SVG of that last atttempt of tracing, or make yet another attempt, and save the SVG file, so we could download, and sort everything out. Or if you could attach the same image after you finish removing the background with GIMP. We just need something concrete from either before, or after, that we can investigate with :D

Pony-Berserker
Posts: 19
Joined: Sun Dec 16, 2012 9:31 am

Re: Problem with Tracing bitmap

Postby Pony-Berserker » Tue Dec 18, 2012 6:54 pm

brynn wrote:"PT is a he" -- awesome, just want to be sure. thanks!

Questions:
2 - exported to what file format/file type -- JPG, GIF, PNG?
3 - If it was exported, or saved in any raster format, it would have had to be imported into Inkscape. Is that what happened? You didn't happen to paste it into Inkscape did you?

In your screenshot, what are we seeing there? The top purple pony, is that the result of the work in GIMP? That's what you imported into Inkscape?

Then below the top pony, we see 2 ponies against a red background or red rectangle. Are both of those ponies from the same trace? Or is one a trace with background, and the other a trace without? If that's the case, then neither one of the trace results contains a background (or iow, background is transparent) otherwise we would not see the red behind it. Or otherwise, if you could explain the screenshot, so we know what we're looking at?

There are some things about your screenshot that are confusing. Like in the top area of the top pony, we can see the page border behind the image, so we know that the background is transparent. But right between the top pony and the red rectangle is a portion of a vertical black line. And something that is covering up the page border.. I can't figure out what that is?

If you could either upload the SVG of that last atttempt of tracing, or make yet another attempt, and save the SVG file, so we could download, and sort everything out. Or if you could attach the same image after you finish removing the background with GIMP. We just need something concrete from either before, or after, that we can investigate with :D


Answers:
1. Exported to png
2. Yep, imported

the top pony is the result of work in gimp

I added the red background to show what is missing from the traced pony. If you look at the ponies on the red background, you see that one has something red in his eye - Inkscape made a random hole in the eye.

And the file I uploaded is just 2 different prtscreens that were put into one image ;) It's like Before/after.

If you still need the pictures, let me know, I'll upload them when I'm back from school.

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

Re: Problem with Tracing bitmap

Postby brynn » Thu Dec 20, 2012 7:07 pm

You said that when you uncheck Remove Background, the result seems to have a background? Could you show us that before and after too? Also, could you show us the original image? There may be a different way to remove the background using Inkscape, which might just solve all the problems (I'm thinking of the SIOX Foreground technique). Or if the original is as simple as this one, it could be "manually" traced fairly easily (to remove the background). Or there may even be a 3rd possibility! But I'd need to see the original -- the original of the real thing, rather than a practice piece :D

PS -- And also, what is the goal for the finished product? That will be the deciding factor, ultimately, in how you want to do this :D

Pony-Berserker
Posts: 19
Joined: Sun Dec 16, 2012 9:31 am

Re: Problem with Tracing bitmap

Postby Pony-Berserker » Sat Dec 22, 2012 1:23 am

brynn wrote:You said that when you uncheck Remove Background, the result seems to have a background? Could you show us that before and after too? Also, could you show us the original image? There may be a different way to remove the background using Inkscape, which might just solve all the problems (I'm thinking of the SIOX Foreground technique). Or if the original is as simple as this one, it could be "manually" traced fairly easily (to remove the background). Or there may even be a 3rd possibility! But I'd need to see the original -- the original of the real thing, rather than a practice piece :D

PS -- And also, what is the goal for the finished product? That will be the deciding factor, ultimately, in how you want to do this :D



I think you might have gotten me wrong - the picture I uploaded was the one I was working on (so you have seen it already) :)

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

Re: Problem with Tracing bitmap

Postby brynn » Sat Dec 22, 2012 2:43 am

Which one -- Twilight_Sparkle_is_smug...jpg; or Foruminkscapetwilight....png. The one called Foruminkscapetwilight....png has already had the background removed. If that's the one, I wanted to see the image before you removed the background in GIMP.

And also, what is your goal for the result of the trace? For example, you just want the same image as vector, maybe to put in a gallery? Or do you want to make transfer design to fabric, like for t-shirt? Or for use with a cutter/plotter, like vinyl decal or something? Often the final goal for the drawing helps us to decide the best way to do it.

I just want to start from the beginning. If I can see the original background, it might help me understand why the piece of the white eye gets removed. Or if I could see the result after you left "Remove Background" unchecked..... If you've already removed the background in GIMP, it doesn't make sense that you would need to use "Remove Background" in the Inkscape trace. You said when you didn't check "Remove Background" that it looked like it still has a background after the trace. I don't know how that could happen, so that's why I wanted to see the result.

So either one -- the original with the original background before you removed it in GIMP; OR the result of the trace when you left "Remove Background" unchecked. The original, with the original background would give me a better chance of answering your questions.

When you followed PT's suggestions, did you have the Trace Bitmap dialog set up exactly like he showed in his screenshots? There should be no need for 50 or 80 scans. So I wonder if you might not have had it set up exactly the same?

Pony-Berserker
Posts: 19
Joined: Sun Dec 16, 2012 9:31 am

Re: Problem with Tracing bitmap

Postby Pony-Berserker » Sat Dec 22, 2012 3:20 am

brynn wrote:Which one -- Twilight_Sparkle_is_smug...jpg; or Foruminkscapetwilight....png. The one called Foruminkscapetwilight....png has already had the background removed. If that's the one, I wanted to see the image before you removed the background in GIMP.

And also, what is your goal for the result of the trace? For example, you just want the same image as vector, maybe to put in a gallery? Or do you want to make transfer design to fabric, like for t-shirt? Or for use with a cutter/plotter, like vinyl decal or something? Often the final goal for the drawing helps us to decide the best way to do it.

I just want to start from the beginning. If I can see the original background, it might help me understand why the piece of the white eye gets removed. Or if I could see the result after you left "Remove Background" unchecked..... If you've already removed the background in GIMP, it doesn't make sense that you would need to use "Remove Background" in the Inkscape trace. You said when you didn't check "Remove Background" that it looked like it still has a background after the trace. I don't know how that could happen, so that's why I wanted to see the result.

So either one -- the original with the original background before you removed it in GIMP; OR the result of the trace when you left "Remove Background" unchecked. The original, with the original background would give me a better chance of answering your questions.

When you followed PT's suggestions, did you have the Trace Bitmap dialog set up exactly like he showed in his screenshots? There should be no need for 50 or 80 scans. So I wonder if you might not have had it set up exactly the same?



As I said - I had deleted them, but because I appreciate your help, I made everything again, and I'm linking 3 pictures - before and 2 versions of "after". And about the purpose of this - seriously - just learning the program :)

[img]src=http://www.sendspace.pl/file/pic/ae62fabb2902bd9059727ec/3[/img] (here, it shows it with a black backgr, but in inkscape it had none - I'm sure of that :)

SVG with eyes and background removed
http://www.sendspace.pl/file/42af0eb7053efb59ce49557

SVG with no background removed... so it appeared again
http://www.sendspace.pl/file/c5c2886c256b68109300922

I hope it clears everything out.
And thanks for your help :)

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

Re: Problem with Tracing bitmap

Postby brynn » Sat Dec 22, 2012 4:06 am

Ok, I just need one last thing. I can't figure out why Inkscape put the background on it, after you had removed it. Could you give me the original where you already removed the background? I do have GIMP, but I don't know how to remove the background, otherwise I would do it myself.

When you removed the background in GIMP, you're sure it made the background completely transparent, and not just white, or partially transparent?

Pony-Berserker
Posts: 19
Joined: Sun Dec 16, 2012 9:31 am

Re: Problem with Tracing bitmap

Postby Pony-Berserker » Sat Dec 22, 2012 6:00 am

brynn wrote:Ok, I just need one last thing. I can't figure out why Inkscape put the background on it, after you had removed it. Could you give me the original where you already removed the background? I do have GIMP, but I don't know how to remove the background, otherwise I would do it myself.

When you removed the background in GIMP, you're sure it made the background completely transparent, and not just white, or partially transparent?


With my little experience with such programs - I can't be sure of anything :D

http://www.sendspace.pl/file/cc6a16fa57cf4126f3dd708 - here is the GIMP file with removed background.

It's fairly simple to remove background from an image, but if you want to do it properly - it would take a lot of time - you just need to select something (in our case - Twilight) using a magic wand and hand selection (wand leaves out some spots you need to select with hand) - then you just make a new layer out of selection by cutting it out, then remove the old layer.

Pony-Berserker
Posts: 19
Joined: Sun Dec 16, 2012 9:31 am

Re: Problem with Tracing bitmap

Postby Pony-Berserker » Sun Dec 23, 2012 12:51 am

@ Pilosopong Tasyo
I understood from the beginning why the tool removes the eyes - didn't know how to stop it from doing so ;)
On the other hand, I had no idea why the tool was adding the background when the option was not checked? :?

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

Re: Problem with Tracing bitmap

Postby brynn » Sun Dec 23, 2012 3:30 pm

Wow....well I haven't digested all of what PT posted, yet. But I will work on it shortly. I guess the bottom line is that the Remove Background option removes the scan on the bottom of the stack, rather than the background of the original raster image!

After converting from XCF to PNG, I imported into Inkscape, and have pretty much the same experience as you. I surely do not understand why it adds a background to an image which originally has a transparent one. Thinking that perhaps Trace Bitmap was taking the white background from Inkscape (even though it's not really white, but transparent) I changed the background color and made it opaque. But the trace result does not take the color from the Inkscape background. It just adds a white background. It just doesn't make sense!

I tried ungrouping the result, and then removing the white scan, but of course, that took the whites of the eyes with it. And it does make sense that the white would be removed with the white background.....well, not a LOT of sense, but at least it's understandable.

Ok, so I've done a bit of experimenting, to add to PT's. Based on what PT found in the manual, I was thinking that Trace Bitmap (TB) might be taking the lightest color from the original raster image, and putting that as a background. So I opened the pony image with background removed (the original XCF) in GIMP, and changed the eye color. I used the Select by Color tool, and clicked on the white part of the eye (which technically is #fafafc), and changed to yellow -- at first, a rather pale yellow (#ffffaa), because I wanted it to still be the lightest color. Then I saved as PNG, and imported in to Inkscape, and ran the trace without remove background option.

The result of that -- newly added background is #fefefe, and the eyes have been changed to #fefefe!! Well granted that TB can't reproduce the exact colors. But they're usually pretty close, so that unless you look with the Dropper tool, you don't usually notice much difference. However, a change from #ffffaa to #fefefe, is a little outside of reasonable expectations, for me.

(Just for comparison:
Image)
I guess the solution to that is adding more scans, but still....I don't count more than 8 colors. Oooohh....ok, when I use the Dropper on the PNG, it shows a lot of colors mixed together to make the obvious colors.

Then I did the same thing again, except changed the eyes to green (#00ff00). The same #fefefe background was added, and the eyes are close enough to the same green. So then I went back to the original trace of the original image, and I see that the original #fafafc eyes were changed to #fefefe, and the new background was #fefefe, like all the others.

So besides adding a background where there was none, I'm really equally surprised that it doesn't make the background #ffffff. Maybe it's somehow not possible?? Since I'm experimenting, I went back and made the pony's mane #ffffff. Import, trace, and the result is the mane is #fdfdfd. So starting with #ffffff, the lightest possible color is apparently #fdfdfd. So perhaps #fefefe is the lightest color that TB is capable of making?

Sssoooo.....well, I do know that TB is not meant to accurately reproduce any image. Some are better suited than others. The reason I asked about your goal for the image, it that TB is fairly well suited for preparing images for screen printing, or any kind of printing where all objects of each color need to be on their own layers. Since TB does one scan for each color, it's fairly easy to prepare any image for that kind of printing (although you do have to create new layers and move objects into them "manually").

Anyway, perhaps it will take someone who knows about the development of Trace Bitmap, to explain why this background is added. I know that I can't explain why. But I do have a fairly quick....actually a couple of fairly quick solutions for you. One would be to ungroup the trace results and delete the white background. Then use Paint Bucket tool to put in the empty spaces (including the stars on the pony's side).

The other is to use a path operation. Note that this will only work on this image, and only if you used 8 scans for the trace. Well, not "only". Maybe it would be better to say that these instructions might not fit accurately to other traces, but the theory could apply to any trace.
1 - Ungroup the scans
2 - Select the light purple scan/object, the color of the main body of the pony
3 - Duplicate
4 - Select the duplicate and the white background
5 - Path menu > Difference
6 - Path menu > Break apart
7 - Deselect everything
8 - Select the background part and delete
That should leave the original white parts still with white in them. Be sure to group everything again, so you can move it around without losing pieces.

I'm sorry that I can't explain why these things happen. But since your goal is just to learn how to use it, at least you've learned something, lol :D Personally, on an image this simple, I would probably hand trace with Pen/Bezier. I should write up a tutorial on that, some day!

Oops, it seems you posted again while I was typing :roll: PT. Of course, this time, I had so much more to say!

Patience, my dear PT, patience -- we try our best, and do what we can. Whatever P-B meant to say, we can't do any more than our best. And I think that's what we've done :D

Pony-Berserker
Posts: 19
Joined: Sun Dec 16, 2012 9:31 am

Re: Problem with Tracing bitmap

Postby Pony-Berserker » Mon Dec 24, 2012 7:24 am

Thanks guys for your help!

@PT - I wasn't clear - I asked what I was doin g wrong because I thought there is maybe some tool or checkbox to prevent TB from removing the eyes - I rather quickly understood what was going on :P
But it doesn't matter. Now I know what I wanted to know - thanks again :)


Return to “Help with using Inkscape”