create repo

This commit is contained in:
mattmcw 2021-03-16 21:33:50 -04:00
commit d287894096
7 changed files with 1425 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
releases

15
LICENSE.txt Normal file
View File

@ -0,0 +1,15 @@
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

60
README.md Normal file
View File

@ -0,0 +1,60 @@
# 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**
# 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.
Other variables:
```java
public int canvasWidth = 800;
public int canvasHeight = 600;
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; //2;
public float MaxDotSize;
public float DotSizeFactor = 4; //5;
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;
```

5
example.config.txt Normal file
View File

@ -0,0 +1,5 @@
display=true
inputImage=grace.jpg
outputImage=output.png
outputSVG=output.svg
maxGenerations=40

48
header.txt Normal file
View File

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created for Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="3200"
height="800"
id="svg2985"
version="1.1"
inkscape:version="0.48.1 r9760">
<defs
id="defs2987" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.35"
inkscape:cx="1600"
inkscape:cy="400"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false" />
<metadata
id="metadata2990">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<g>

After

Width:  |  Height:  |  Size: 1.3 KiB

1288
stipple_gen.pde Normal file

File diff suppressed because it is too large Load Diff

8
stipple_gen.sh Normal file
View File

@ -0,0 +1,8 @@
#!/bin/bash
# processing-java requires the full path of the sketch
SKETCH=`realpath ./`
# pass all arguments on bash script to stipple_gen.pde sketch
processing-java --sketch="${SKETCH}" --run \
"${@}"