A sketch for turning images into stippled drawings using a headless interface.
Go to file
mattmcw 6a3c991dc2 Add configuration options for fillAngle (default 45 degrees) and fillRandom, which will randomize the angle on every dot drawn. Calling this release 2.1.2. 2021-12-08 23:19:39 -05:00
.gitignore Ignore DS_Store files 2021-08-03 01:23:29 -04:00
LICENSE.txt create repo 2021-03-16 21:33:50 -04:00
README.md Add configuration options for fillAngle (default 45 degrees) and fillRandom, which will randomize the angle on every dot drawn. Calling this release 2.1.2. 2021-12-08 23:19:39 -05:00
build.sh Build mac 2021-11-30 14:47:57 -05:00
example.config.txt create repo 2021-03-16 21:33:50 -04:00
header.txt Made an important change that removes some of the mystery in the scaling values. Originally it was using an arbitrary value of 1536x1056 and was scaled at 800 / canvasWidth (???). Now it will be set to the canvas value, which gives the user control over the final resolution of the SVG. 2021-08-03 00:36:57 -04:00
stipple_gen.pde Add configuration options for fillAngle (default 45 degrees) and fillRandom, which will randomize the angle on every dot drawn. Calling this release 2.1.2. 2021-12-08 23:19:39 -05:00
stipple_gen.sh create repo 2021-03-16 21:33:50 -04:00

README.md

stipple_gen

A friendly fork of StippleGen_2 from Evil Mad Scientist Laboratories.

https://github.com/evil-mad/stipplegen

This script takes an image, provided as a JPEG, a PNG or a TIFF (generated by Processing) and outputs both an SVG for a plotter as well as a approximation as a JPEG, PNG or TIFF.

There have also been features added to do the following:

  • Custom output SVG scale
  • Custom canvas size
  • Option to fill in circles with hatch lines

Usage

stipple_gen is designed to be configured and run from the command line, rather than the GUI provided in the original sketch. By creating a config.txt file in your sketch directory OR providing command line arguments to your sketch you can set all of the variables accessible to the GUI in the original StippleGen_2 sketch and then some.

An example using the helpful stipple_gen.sh script provided by this project.

bash stipple_gen.sh --display true --inputImage myImage.jpg --outputImage myStippledImage.jpg --outputSVG myStippledDrawing.svg

This will take your original image myImage.jpg and run it through the stippling process using the default variables for everything and output two files for you: myStippledImage.jpg and myStippledDrawing.svg, the latter of which you can use on your plotter.

The --display true arguments will show the progress of the script in the main window, which the default. Run it headless with --display false.

Other variables:

public int canvasWidth = 800;
public int canvasHeight = 600;
public float canvasScalar = 1.0;

public boolean display = true;
public int windowWidth = 800;
public int windowHeight = 600; 

public boolean invert = false;

public boolean selectInput = false;
public String inputImage;
public String outputImage;
public String outputSVG;

public int centroidsPerPass = 500;
public int testsPerFrame = 90000;
public int maxGenerations = 5; //number of generations

public float MinDotSize = 1.25;
public float MaxDotSize;
public float DotSizeFactor = 4;

public int maxParticles = 2000;   // Max value is normally 10000.
public float cutoff =  0;  // White cutoff value

public boolean gammaCorrection = false;
public float gamma = 1.0;

public boolean fill = false;
public boolean dot = false;
public float line = 1.0;

This sketch can also be run from the Processing IDE, though it is best to provide arguments with a local config.txt file when doing so. There isn't a consistent way to provide command line arguments to the IDE on all platforms.

LICENSE

This is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

http://creativecommons.org/licenses/LGPL/2.1/

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA