Page 1 of 1

Inverting an image that's already traced as a Bitmap

Posted: Sun May 12, 2019 10:02 pm
by djcamera
I'm using Inkscape to create a vector graphic for a laser cutting project. I'm hitting a snag.
I'm using this font: Image

See how that white line runs through the letters? I want to make the colored part of the letters a FILL, then make the white line part a STROKE. Because I want to cut out the white line part in thin acrylic, and add it to the project as an inlay.

So I think I have to Invert the image and save the interior of the letters as a separate .svg. Problem is, when I select the letters, and hit "Path/Trace Bitmap", nothing happens. I believe that is because it's already a bitmap.

So how do I isolate the interior of these characters to save as a separate .svg? Can I revert the Bitmap back to its "untraced" state?

Or how else can I do it? Thank you.

Re: Inverting an image that's already traced as a Bitmap

Posted: Sun May 12, 2019 10:56 pm
by Moini
So, this is a font, i.e. a text you typed?

Then do the following:

Path > Object to path (you can skip this if the text is already a path)

Are you sure you want the white part to be just a cut line, with no area? I'm not sure how one could inlay anything in just a plain cut?

If it's supposed to be a line, the quickest way will be to just draw that line.

If it's suppposed to be an area, you need to use the node tool to remove the outsides of the letters, and to connect the insides.

Re: Inverting an image that's already traced as a Bitmap

Posted: Sun May 12, 2019 10:59 pm
by Moini
(to save some time, you should only do this once per letter in the alphabet, and duplicate the result for any other occurrances of that letter)

Re: Inverting an image that's already traced as a Bitmap

Posted: Mon May 13, 2019 2:08 am
by djcamera
Moini wrote:Are you sure you want the white part to be just a cut line, with no area? I'm not sure how one could inlay anything in just a plain cut?


My laser cutter handles thin glossy acrylic cuts very nicely, even superfine and small detail. So my plan is this: The font will be on my wood project, with the colored parts cut as a STROKE, meaning they will be clearly outlined. The white part will be a deep ENGRAVE, which leaves a groove. So without resizing anything, I need to cut the white part ONLY out of acrylic. The resulting acrylic pieces will (in my mind) nestle perfectly into the grooves.

But I need to isolate just the white parts, and send THAT vector to the laser cutter.

Selecting and making the colored parts of the letter as a vector is easy. Now if I could only "invert" the selected bits, and assign a color to the white lines...

Re: Inverting an image that's already traced as a Bitmap

Posted: Mon May 13, 2019 2:12 am
by djcamera
Moini wrote:So, this is a font, i.e. a text you typed?


And oh: to your other question, and one that might be relevant: No, it's not a text I typed. I used a FONT GENERATOR online, screen-captured the words I want to use, imported the JPG image into Inkscape, and traced the bitmap.

Re: Inverting an image that's already traced as a Bitmap

Posted: Mon May 13, 2019 4:27 am
by flamingolady
Perhaps I'm not understanding totally, but I seem to do the out of the box fixes from what everyone else does anyway, lol. I'm thinking you could duplicate your text, then do either an inset/outset or dynamic offset to get the white part. Or, basically duplicate twice and make one larger, then path difference/exclude etc, or manually remove the outside nodes. Oh wait, if the color part of the font is just the stroke, then duplicate, make it be no stroke, and change the white 'line' to be a color that you can see. you can enlarge or decrease the size, but now you have two 'fonts', one for the outside (colored part) and one for the inside. Probably several ways to accomplish this, depending on your Inkscape knowledge and desired output.

Re: Inverting an image that's already traced as a Bitmap

Posted: Mon May 13, 2019 6:41 am
by tylerdurden
Here's one way...
Download the font, install for all users, restart (or start) Inkscape then:

Image

Rinse and repeat...

Re: Inverting an image that's already traced as a Bitmap

Posted: Mon May 13, 2019 9:31 am
by cleversomeday
The problem here is that there is no white line in this font. There is merely open space that your brain interprets as a line. In order to trace it, you have to give it a boundary. One way to do this is to just block the ends with black rectangles, then use the paint bucket tool to trace the white, which is now bounded. The other option is to find a font the white lines enclosed, like Tron or Ostrich Sans Inline, for example.

Re: Inverting an image that's already traced as a Bitmap

Posted: Mon May 13, 2019 10:27 am
by druban
@DjCamera: you seem to have a fair degree of proficiency so I'll skip the basic stuff, just ask if you don't understand something. Conversely, if I haven't understood what you're asking, correct me! I believe you are asking for a single line, so some of these other solutions may not be exactly what you want.

The first problem is that you require something that Inkscape users have wanted for a long time that has not been written into the program yet, namely, a Centerline trace function. There are workarounds and external solutions.
The second problem is that Inkscape, like almost all desktop vector drawing programs, does not allow branching in a path, I.e. a node can only be connected to no more than 2 other nodes. Which is to say the letter Y cannot be drawn as a single path. In the word TEST123 for example, the letters T and E cannot be done as single stroked paths, so you will have to come up with a plan for those that lets you engrave them correctly.
The other letters can be converted to a single stroke thusly (using S as an example):

rect5244.png
rect5244.png (45.92 KiB) Viewed 1709 times

Re: Inverting an image that's already traced as a Bitmap

Posted: Mon May 13, 2019 11:19 pm
by Moini
druban, yes! I didn't think of the Interpolate LPE.

Re: Inverting an image that's already traced as a Bitmap

Posted: Fri May 17, 2019 11:31 pm
by djcamera
tylerdurden wrote:Here's one way...
Download the font, install for all users, restart (or start) Inkscape then:
Rinse and repeat...


Thank you! That was very helpful!

Re: Inverting an image that's already traced as a Bitmap

Posted: Fri May 17, 2019 11:33 pm
by djcamera
druban wrote:@DjCamera: you seem to have a fair degree of proficiency so I'll skip the basic stuff, just ask if you don't understand something. Conversely, if I haven't understood what you're asking, correct me! I believe you are asking for a single line, so some of these other solutions may not be exactly what you want.

The first problem is that you require something that Inkscape users have wanted for a long time that has not been written into the program yet, namely, a Centerline trace function. There are workarounds and external solutions.
The second problem is that Inkscape, like almost all desktop vector drawing programs, does not allow branching in a path, I.e. a node can only be connected to no more than 2 other nodes. Which is to say the letter Y cannot be drawn as a single path. In the word TEST123 for example, the letters T and E cannot be done as single stroked paths, so you will have to come up with a plan for those that lets you engrave them correctly.
The other letters can be converted to a single stroke thusly (using S as an example):

rect5244.png


Thank you. Interesting about the 'no branching' thing in Inkscape. Learning more and more about this program every day.