Make Your Own Scribble Drawing
Intro: Make Your Own Scribble Drawing
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:
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:
- Processing3 from https://processing.org/download
- UGS Classic from https://winder.github.io/ugs_website/download/
- Fotosizer from https://www.fotosizer.com/
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
matthewtmead 2 years ago
lingib 2 years ago
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.
matthewtmead 2 years ago
lingib 2 years ago
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
matthewtmead 2 years ago
lingib 2 years ago
Let's know how you get on :)