Bitmap vs. Vector discussion and using Inkscape

Frequently Asked Questions
Post Reply
Jeffrey Aley
Posts: 388
Joined: Fri Aug 11, 2017
Location: Folsom, California
Country: United States
Laser Machine Make or Type: Kehui
Laser Power: 50W
Laser Bed Size: 500mmx300mm
Home Position: TL
RDWorks Version: 8.01.24
Ruida Controller: RDC6442
Windows Version: Win10 Enterprise
Accessories: Spray bottle with water (for small fires)
Fire extinguisher (for big fires)

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!
You do not have the required permissions to view the files attached to this post.
User avatar
Gene Uselman
Posts: 2180
Joined: Thu Jul 07, 2016
Location: Suburban Minneapolis, Minnesota, US
Country: USA
Nickname: Gene
Laser Machine Make or Type: QC
Laser Power: 130W
Laser Bed Size: 900x1300
Home Position: TR
Control Software: LIGHTBURN
RDWorks Version: RDw .19 & Lightburn
LightBurn Version: Latest
Ruida Controller: RDC6442
Windows Version: Win 10 Pro
Accessories: I have a combining lenses, pin tables [homebuilt], honeycomb tables , wireless remote, Modifed Ultimate Air Assist, home built non-powered rotary device, PrusaMK4 and Mini Prusa printers.

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
If the Help and advice you received here was of VALUE...
Please consider making a donation to maintain the RDWORKSLAB Forum.



The days that I keep my gratitude higher than
my expectations, Well, I have really good days.

Ray Wylie Hubbard- unfortunately deceased
Post Reply

Return to “FAQ”