Halftoning, or “Pixel Machining” with a CNC Router

jcopro-logo-pixel-machiningRecently I got the idea that if you were to take an image made up of pixels, as opposed to one made with vector graphics, it could still be machined (as opposed to converted to a vector for engraving).  The process I was thinking about, similar to a process known as halftone printing, would translate each pixel into a point to be milled.  Dark would be a hole, where light would be no hole.  Possibly there could be some in between shades where the depth is variable, but I haven’t gotten to that yet.

Although similar operations have been done before, I decided to write my own Python script (available here) to translate everything.  The whole thing is done using the Python Image Library.  I actually used parts of this script to do some light paintings with the pyMCU.

That’s the video of the process, but there’s more pictures of the finished product, and some of the images I used below.  The JcoPro logo on top is done using the tiny 1 mm ball nosed end mill from Zen Toolworks.  They carry a lot of little bits for the ZTW router, and were gracious enough to provide me with a few to use.

This process is fun on wood, but also could be applied to making a stencil.  I did something similar with a  vector file for use with a bleach T-shirt.  In a future post I’ll go over my results making a stencil using “Pixel Machining.”

Again, here’s the Python source code that I used to do this.  I’m not sure what I’ll eventually do with it, but my thinking is that anyone familiar with Python that sees my methods explained, could probably crank out the code anyway.  If you have any questions, improvements to suggest, or want to add to it, please let me know! Also, check out my other posts on learning and working with the Python programming language.  As I get better, my ability to make programs like this will hopefully get better as well.


  1. Awesome.

    Clemson fan?

  2. Pretty cool.

    If it could alternate the direction of drawing the pixels each “scanline” it might be quicker as it wouldn’t have to go to the beginning of the next line each time.

    • True – need to put some more thought into how to do this. I’m a pretty novice programmer, but that shouldn’t be too hard!

      Thx for commenting!

  3. wow, are you a magnet?

    • Yes, actually.

        • You wouldn’t believe how incredibly smart these magnets that I use are. I think that’s why they “outlawed” buckyballs, it was going to become a Terminator-type situation. It’s just as well, I was getting lazy.

          • [/trolling]

            So annoyed that they outlawed buckyballs. You can have a swimming pool that kills >500 children under 10 every year. You can have prescription medications, some of which are unnecessary, that kill children constantly through overdose and misuse. You can buy all the alcohol and guns you want, without even checking to see if you have a past history of abusing these things, together killing ~20,000 people per year through murder and DUI alone.

            I don’t mind these risks at all; I might be the next victim. I don’t care, I’d rather live in a free society. We’re governed by emotion instead of logic.


          • Yeah, besides agreeing with the whole free society thing, it really annoyed me as well because Buckyballs sampled me a couple sets to review here about a year ago. They were quite fun to play with, but I guess I won’t be getting any more :(.

            Wasn’t that an episode of Always Sunny in Philadelphia, where they tried to vote on stuff unemotionally? “Reason will prevail!”

  4. JCoPro.net Free CNC "Art" free Giveaway - pingback on April 7, 2013 at 1:12 pm
  5. More "Pixel Machining" AKA Halftoning Experiments - pingback on April 10, 2013 at 9:45 am

Trackbacks and Pingbacks: