Make Your Own Scribble Drawing

3.1K106

Intro: Make Your Own Scribble Drawing

a.articles { font-size: 110.0%; font-weight: bold; font-style: italic; text-decoration: none; background-color: red; } a.articles:hover { background-color: black; }

This instructable explains how to convert photos into squiggly line artwork.

When framed these artworks make unique gifts.

It is expected that you have access to a CNC plotter with an on-board interpreter.

The cover photo and attached artwork were produced using this plotter:

https://www.instructables.com/CoreXY-CNC-Plotter/

STEP 1: Theory

A complex algorithm is used to draw a series of squiggly lines. [1]

Imagine a white checker-board such that each checker-position represents one pixel of the original monochrome image.

Let’s now imagine that we represent an image using “black” checkers where:

  • No checkers represents “white”
  • A stack of “black” checkers represents varying shades of “gray” depending on height

The pen is then moved in a random and wiggly fashion over the checker-board:

  • If the pen sees “white” the pen is raised ... no ink is laid
  • If the pen sees “black” the pen remains lowered, and a checker is removed,. On future passes the pen will lay more ink making that area of the image look darker.
  • The pen will remain raised once all of the checkers have been removed

This isn’t quite what happens but is a good mental image when adjusting the following header variables:

  • int numSteps = 32; // Number of contiguous coordinates
  • int fadeAmount = 32; // Grayscale ... controls line density

Note

[1]

My code, "Squiggle_bot_v1.pde", adds G-code and file-handling functionality to the work of Parth Sarthi Sharma.

STEP 2: Hardware

The g-code from this project should work with any CNC plotter that has an onboard interpreter.

DIY plotters that work particularly well include:

STEP 3: Software

The following third-party software is required:

In addition the following attached software and support files are required:

  • “squiggle_bot_v1.pde”
  • “face.jpg”
  • “flower.jpg”
  • “logo.jpg”

Each of the above "jpg" files is attached with a file-extension of "txt".

Change the file-extensions from "txt" to "jpg" once you have downloaded them.

STEP 4: Software Installation


  • Install the third-party software as per the instructions on each of their respective websites.
  • Copy the contents of “squiggle_bot_v1.pde” to a new processing sketch and save the file as “squiggle_bot_v1” without the “” quotes. Use a text editor such as “Notepad++.exe” ... not a word processor.
  • Download each of the "txt" files in Step 3 and change their file extensions to "jpg"
  • Copy each of the “jpg” files into the “squiggle_bot_v1” folder.
  • This completes the installation

STEP 5: Creating Your First Image

  •  Launch Processing
  • Open the file “squiggle_bot_v1.pde”
  • Left-click the Processing “Run” button ...an image should start to appear in a display window
  • Position the mouse over the screen image and mouse-click to stop
  • A file “drawing.gcode” containing the g-code will appear in the “squiggle_bot” folder

Photo 1 is a screenshot from the opening video.

  • The g-code output file “drawing.gcode is shown at the left.
  • The scribble drawing is in the middle
  • The original image is shown on the right

STEP 6: Preparing Your Images

A list of paper dimensions follows:

  • A5 = 148 * 210 mm
  • A4 = 297 * 210 mm
  • A3 = 297 * 420 mm
  • A2 = 420 * 594 mm
  • A1 = 594 * 841 mm
  • A0 = 841 * 1189 mm
  • 2A0 = 1189 * 1682 mm
  • 4A0 = 1682 x 2378 mm

Reduce your image size such that the finished image fits inside your target paper size dimensions. A suitable program is Fotosizer from https://www.fotosizer.com/

Copy this file to your “squiggle_bot_v1” folder.

Assuming your “image.jpg” is 150 pixels wide and 200 pixels high, edit the Processing header to read:

  • String image = "image.jpg";
  • int imageWidth = 150;
  • int imageHeight = 200;

This will result in a printed image 150mm x 200mm on A4 paper which is the default.

STEP 7: Printing Your Image


  • Connect your plotter to your PC
  • Position your paper such the the pen is in the lower-left corner
  • Launch UGS (Universal gcode sender)
  • Connect to the plotter
  • Browse for “drawing.gcode” in the “squiggle_bot” folder [1]
  • Click “Open”to open the file
  • Click “Visualiser” to view the plotter paths
  • Click “Send” ... the plotter should start plotting

Your screen should resemble photo 1

Note

[1]

Processing overwrites the default output file “drawing.gcode” each time it is run.

Rename "drawing.gcode" to something else prior to each run. This will prevent your previous work from being overwritten.

STEP 8: Summary

  • This instructable explains how to convert photos into a squiggly line artwork.
  • The cost of consumables is less than $20

  Click here   to view my other instructables.

6 Comments

I've been noticing super cool squiggly pictures on Pinterest and have been wanting to do the squiggle effect for a photo. THANKS for sharing, I'm gonna do this following your instructions!
Thank you for commenting :)

If you see something that you like, save it under it's own file name as no two "runs" produce the same scribble pattern.

The drawings in my article were produced using a 0.1mm pen-width. If you choose to use a thicker pen you will need to experiment with the values for "numSteps" and "fadeAmount" for best effect.

Lignib, thanks for the feedback! I’m definitely getting awesome results using your technique and processing program. I’m using an extra fine gel pen and a 3D printed pen holder on my Inventables xcarve CNC using UGS to send code. I wrote a python script to tweak the gcode to adjust the feed speed and am attempting to use G01 Z10 and G01 Z-10 to raise and lower my Z gantry/pen as M3 and M5 are not doing anything. I’m assuming my need to tweak is related to the GRBL implementation and/or configuration I have loaded on my CNC‘s xcarve controller. I am still messing around, but If my findings/script appear to have value for others I will definitely share!
Hi Matthew
Thanks for your feedback ... you've just made my day :)

I follow what you are doing but there may be a simpler way of achieving the same results. The save() function inserts the necessary GRBL commands for raising and lowering the pen ... just replace my M3 and M5 servo commands with the necessary F(eed) and Z codes/code-sequences for your Inventables Xcarve CNC.

The save() function keeps track of the pen status and inserts a code sequence whenever the instructions change from G00 (pen-up) to G01 (pen-down) and vice-versa (code lines 365, 366, and 372, 373).

GRBL also requires one-off S(peed) and F(eed) values to work (code lines 343, 344).
Cheers Lindsay
Lindsay, thanks so much. Kinda funny...I was thinking about the fact that I wrote a new script and wondered if it would be easier to tweak your code, as you are suggesting. Thanks SO much for all the detailed information. I hope this coming week to have time to tinker with it and make the changes you suggested. I'm hoping to make a valentines gift for my wife using your technique for a picture, thanks!
You're welcome.
Let's know how you get on :)