A sketch for turning images into stippled drawings using a headless interface.
Go to file
mattmcw 41927aec1f Add dot mode. For single-point plots, like for paint pens. 2021-12-02 16:06:15 -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 license to readme 2021-03-26 20:38:42 -04: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 dot mode. For single-point plots, like for paint pens. 2021-12-02 16:06:15 -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.25;

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 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