HOW TO: Understand the difference between Raster and Vector graphics

By Michael Reilly

Raster Images

Raster images are constructed on a grid. Each grid square is called a pixel and can be filled with a color. We see patterns of these pixels as shapes or elements of a photograph. The more pixels per inch an image is made of, the more detail can be included. While compression methods were created to help deal with it, raster files contain information about each pixel in the image whether it has a color or not. This means raster image files can be quite large, especially at higher resolutions. Digital photographs and almost all images on the web are in raster format. Typical file formats for raster images are .jpg, .jpeg, .png, .gif, .tif, and .bmp.
To reproduce a raster image using the laser, we use engraving or raster mode. In this mode, the laser head scans back and forth similar to an ink jet printer. The red lines show us how the scanning takes place. The machine pulses the laser on and off a certain number of times per second. The laser beam is round, so the marks it makes are round. In this example, it’s pulsing 200 times per inch. It also scans back and forth the same 200 times per inch. As you can see, this would leave a serrated edge to the line drawing this square.
If we double the resolution to 400, the dots overlap making a much smoother line. The downside is that it now has to scan back and forth twice as many times which will take twice as much time to run. The finer the detail we want to reproduce, the higher the resolution we need to use for good results.While it is possible to turn the power up high enough on some materials for these dots to cut through, but this mode isn’t meant for cutting. For that, we need to use Vector images.

Vector Images

Vector images are also built on a grid based system, but it doesn’t use pixels. Instead, it uses a set of written instructions that describe the graphic element in terms of points called nodes. In this example, The file would give each of the coordinates in the order that the line or vector connects them.The vector line and nodes are represented here in blue. The black line is called a stroke. It is a line that has a set width and a color. Because this is a closed shape, we could also fill it with a color. In the example image, we have a 1px black stroke with no fill.We can treat vector shapes and strokes as raster and engrave them the same as we do with raster images. Most laser cutters treat any vector line with a stroke 0.25 point (0.0035″) or less as a cut line, and anything thicker or any fill as raster data. Engraving vector shapes will always be sharper than engraving raster images, but engraving resolution still matters.Typical file formats for vector images are: .ai, .eps, .dxf, .pdf. Note that most of those formats can also store raster content, so just because a file is .eps, doesn’t mean it’s automatically a vector.
When we send a job to the laser for cutting, it’s going to cut the vector line (blue, above). If there is a stroke, the laser will cut down the center of the stroke, not at the perimeter.  The laser spot is 0.005″ in diameter. We can visually approximate what will get cut by setting our vector lines to a 0.5pt stroke. For cutting, the laser will move point to point as indicated by the red line. The laser still pulses, but at a much higher rate that varies by material type. Pulse frequency does not change cutting time, that is affected instead by distance traveled, the number of nodes, and the speed necessary to cut through the material.
If we tried to create a circle with just straight segments, we would need to use many nodes and short segments, but that would lead to a long runtime as the laser has to be told to move from point to point. Luckily, we have the ability to define curves. Every node has two “handles” that can be used to define the length and arc of the curve. The length and direction of the handle line influences how the line is stretched from the node.
Using only 4 nodes and correct handle placement, we can get a perfect circle. Defining shapes using the fewest number of points leads to the most efficient cutting job.