Our team needed to convert greyscale and color images into something that could be drawn with one or more pens. For greyscale images, one black pen was used at a time. Color images on the other hand were broken up into their CMYK (cyan, magenta, yellow, and key (black)) channels. The CMYK color system uses subtractive color mixing, allowing a full range of colors to be show by layering various amounts, the same system modern printers use. Two different methods were used to convert images into coordinates to place ink on paper.
An image can image can be converted into a set of black and white pixels or points using a method called dithering. After an image is cropped, it is also resized to reduce the total number of dots needed to replicate the image. The algorithm used to convert the greyscale images into black and white is called Floyd–Steinberg dithering. Once the image is now a group of black and white pixels, coordinates for the centers of the pixels can be used to draw an image.
An image can also be converted into a series of overlapping lines using cross hatching. The image is separated into multiple thresholds for different levels of value. Starting with the darkest threshold, lines with a constant slope and linearly varying offsets from one another are calculated across it. When the line meets something that is darker than the threshold, a starting point for a line is created. An ending point is created when it meets something brighter than the threshold or the bounds of the image. This process is repeated for more thresholds with different slopes to create a cross hatching effect.