Halftone Image G Code Creator


It occurred to me that while lithophanes are quite amazing, they are quite limited, in that you need the light to be able to shine through the material. How is it possible to create images on a surface. Carving them with a CNC machine in bas relief requires a solid model, and unless you use a depth map, it's quite a task to create the surface to machine. And it doesn't solve the problem of taking any old picture and putting it on the surface of the machined object. So how to do it...?

To get a picture you need contrast. What pictures use 2 colours? Well, black & white newspaper pictures do. These are 'half tone' images. It is not possible for a CNC machine to completely replicate this effect, but you can get quite close to it. If you use a Vee shaped tool, and plunge into the centre of each pixel to a depth determined by the brightness of the pixel, and the angle of the tool sides determine the final diameter of the pit. After machining, fill the resulting pits with a contrasting material, such as a wax or paint. Then the picture will appear, with the varying diameters simulating the half tone graduations you see on printed monochrome images.

Here is an example:

The image is very small, only 125 x 86 pixels. Part of the reason for this is time, scanning across a bitmap takes time for a cnc machine. The program data is filled in (when something isn't quite right, information is given as to the problem and it is not possible to generate the path). The program looks as below:

Then in Mach 3, the toolpath is:

The program works by scanning over the image and for each non white pixel it determines a depth to which the V tool needs to be plunged. After retraction at rapid feed, the machine then moves to the next pixel position at rapid feed. Think of it as a peck drill operation at each pixel... There are limitations. If you use a very pointed cutter, it needs to be plunged in quite deeply to get the required diameter, needing a thick material. However with very large angles between the sides of the cutter (say 118 degrees for a standard drill) the picture is very sensitive to the work surface being exactly at the position it should be. There is a compromise to be struck that suits your material thickness and machine/work accuracy.

In all fairness, I have to admit that this program does not really work with plastics. The material has so many holes pecked into it that there is no strength left, and it's all to easy to wipe the top surface off with the swarf.

The program can be downloaded below. The program, a readme file and source code are included in the zip file.

Download the Halftone Image G Code Creator Program. (326 kb)

The program is a Windows program, and is known to run on Windows XP and Windows 7 (32 & 64 bit versions). It should work in any 32 bit windows operating system. The program is a single file .exe file and writes a windows .ini file in the directory you put the programs into. The Borland C++ Builder 4 source code is included so that you can check for yourself that the program does nothing unpleasant to your computer.

Chestnut Pens Miscellaneous Pages Home
Chestnut Pens Home