A sketch for turning images into stippled drawings using a headless interface.
Go to file
mattmcw b42b21a444 Update the scalar for the canvas. There is still an uncomfortable relationship between the actual scale of the image and what the "canvas" scale accomplishes. 2021-03-26 21:52:54 -04:00
.gitignore create repo 2021-03-16 21:33:50 -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
example.config.txt create repo 2021-03-16 21:33:50 -04:00
header.txt Remove the offsets 2021-03-25 19:02:50 -04:00
stipple_gen.pde Update the scalar for the canvas. There is still an uncomfortable relationship between the actual scale of the image and what the "canvas" scale accomplishes. 2021-03-26 21:52:54 -04: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