Page 1 of 1

Bitmap vs. Vector discussion and using Inkscape

Posted: Sat Mar 16, 2019
by Jeffrey Aley
EDITED FROM AN ANSWER TO A QUESTION- ANY CONFUSION IN THE TEXT IS MY DOING- GDU

Let me start by describing the two relevant types of images (which you may already know about). The most common images we see on our computers are "bitmaps". When we take a picture using our phones (or digital camera), or when we draw something in Photoshop, we are creating a bitmap. To the computer, a bitmap is an array (map) of dots (bits). The computer knows the first pixel (dot) is black, and the next one is red, and the next three are blue, and so on, dot-by-dot and row-by-row. The computer has no idea what all those dots represent - it doesn't know that they're arranged to form a straight line, or a curve, or a letter, or a dog. Common computer file formats for bitmaps are jpg, JPG, BMP, TIF, TIFF, GIF, PNG.

From a laser perspective, because the laser is controlled by a computer, all it can do is "scan" or "raster" this image - it goes along the row and fires the laser according to the color of the dot. That's why we see our lasers going back and forth, row by row to mark our image onto wood, glass, or whatever.

The second type of image the computer can understand is a "vector". With a vector image, the computer stores mathematical equations for the lines and curves. Remember your high-school geometry class? We know an infinite line can be represented by y=mx+b. There's a bit more to the equation to describe where the ends of the line are located. Circles are denoted by the X,Y coordinate of the center, the radius, and the ends of the arc. And so forth. Because the computer understands that each element is a line or a circle, or whatever, the computer can also understand how to manipulate or modify those lines, circles, and curves. Common computer file formats for vectors are DXF, SVG, AI, CDR, PPT, and PPTX (yes, PowerPoint).

From a laser perspective, because the computer controlling the laser understands each element (line, curve, etc), it can direct the laser to follow that "path", which is how we cut things out. The laser turns on, follows the path, then turns off.

Okay, enough background, now let's solve your problem.

Suppose we have a bitmap and we want to convert it to a vector. How can we do this? It actually requires some pretty sophisticated computing to analyze a bitmap and realize that the pixels are arranged in a curve or a line or whatever. This is complicated by the need to distinguish between the colors of the pixels. Fortunately, there is free software that will do it for us. I use Inkscape. This is a vector-drawing program, analagous to Corel Draw or Adobe Illustrator. It's shareware, so it's free, but that also means that it's not as easy to use as the other two.

After downloading and installing, use File -> Open to open the relevant image (in my case, a jpg file).
Once it's opened, use the arrow tool to select the image.
Capture1.JPG
Then go to Path -> Trace Bitmap. You'll have to play with the settings in the Trace Bitmap window to get an optimal image. If the image isn't too complex, tick the "live update" box so you can see the preview of what you'll get. Otherwise remember to click the "Update" button to update the preview while you're adjusting the settings. An example setting that I used recently was Brightness Cutoff, threshold=0.450. On a different image I had to set the threshold to 0.700.
When you're satisfied, click OK.
Inkscape will put the resulting vector image right on top of the bitmap, making it hard to see. Use the arrow tool to move the vector image off to the side so you can see what you got. Hopefully it'll look a lot like the bitmap.
Capture02.JPG
There's some extra "fill" going on; to see what you REALLY got, go to the Fill and Stroke window and set the Fill to "X" [none] (egads! the image disappeared!) and the Stroke to solid black (whew! the image reappeared). Now you can see the actual lines (vectors) that RDWorks will see.
Capture03.JPG

If you're satisfied, you can select and delete the bitmap, and then Save As using the .dxf file format.

In RDWorks, you can File -> Import [Open won't work] the .dxf file and then cut it.

Enjoy!

Re: Curved Line with software

Posted: Sat Mar 16, 2019
by Gene Uselman
Jeffrey- I am going to copy this to the FAQ section and rearrange it slightly to make it easier for members to find it. Thanks Gene