stipple_gen/README.md

67 lines
2.4 KiB
Markdown
Raw Normal View History

2021-03-17 01:33:50 +00:00
# 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**
2021-03-17 01:33:50 +00:00
# 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
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.
2021-03-17 15:35:59 +00:00
The `--display true` arguments will show the progress of the script in the main window, which the default. Run it headless with `--display false`.
2021-03-17 01:33:50 +00:00
Other variables:
```java
public int canvasWidth = 800;
public int canvasHeight = 600;
public float canvasScalar = 1.25;
2021-03-17 01:33:50 +00:00
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;
2021-03-17 01:33:50 +00:00
public int maxGenerations = 5; //number of generations
public float MinDotSize = 1.25;
2021-03-17 01:33:50 +00:00
public float MaxDotSize;
public float DotSizeFactor = 4;
2021-03-17 01:33:50 +00:00
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.