tProgram functional, generates readme with example - cross-stitch - interactive… | |
git clone git://src.adamsgaard.dk/cross-stitch | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit c7c82215f1b892845a60a2ea4a3e97708197a30a | |
parent 83d987cba9ed0d80ee145e8797c93cdcbc1fc701 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Thu, 13 Feb 2014 22:17:24 +0100 | |
Program functional, generates readme with example | |
Diffstat: | |
A Makefile | 9 +++++++++ | |
M README.rst | 28 +++++++++++++++++++++++----- | |
M cross-stitch.py | 2 +- | |
A fisker-pattern.png | 0 | |
A fiskeren.jpg | 0 | |
A generate-readme.sh | 55 +++++++++++++++++++++++++++++… | |
6 files changed, 88 insertions(+), 6 deletions(-) | |
--- | |
diff --git a/Makefile b/Makefile | |
t@@ -0,0 +1,9 @@ | |
+README.rst: generate-readme.sh cross-stitch.py fisker-pattern.png | |
+ @bash $< $@ | |
+ | |
+fisker-pattern.png: cross-stitch.py fiskeren.jpg | |
+ @python $< -i fiskeren.jpg -o $@ | |
+ | |
+clean: | |
+ $(RM) README.rst | |
+ $(RM) fisker-pattern.png | |
diff --git a/README.rst b/README.rst | |
t@@ -1,5 +1,5 @@ | |
cross-stitch | |
------------- | |
+============ | |
A Python application to turn your images into patterns for cross stitching. | |
t@@ -17,11 +17,29 @@ License | |
------- | |
GNU Public License version 3 or newer. See LICENSE.txt for details. | |
+Author | |
+------ | |
+Anders Damsgaard ([email protected]) | |
+ | |
Usage | |
----- | |
- usage: cross-stitch.py [-h] --infile FILENAME --outfile FILENAME [--dpi DPI] | |
+ | |
+./cross-stitch.py -h | |
+ | |
+Example | |
+------- | |
+ | |
+ $ ./cross-stitch.py -i fiskeren.jpg -o fisker-pattern.py -w 50 | |
+ | |
+.. image:: fiskeren.jpg | |
+ :scale: 50 % | |
+ :alt: Original image | |
+ :align: left | |
+ | |
+.. image:: fisker-pattern.png | |
+ :scale: 60 % | |
+ :alt: Cross stitching pattern | |
+ :align: right | |
+ | |
-Author | |
------- | |
-Anders Damsgaard ([email protected]) | |
diff --git a/cross-stitch.py b/cross-stitch.py | |
t@@ -24,7 +24,7 @@ parser.add_argument('--n-colors', '-c', type=int, nargs=1, d… | |
args = parser.parse_args() | |
infile = args.infile[0] | |
outfile = args.outfile[0] | |
-width = args.width[0] | |
+width = args.width | |
## Read image ################################################################… | |
try: | |
diff --git a/fisker-pattern.png b/fisker-pattern.png | |
Binary files differ. | |
diff --git a/fiskeren.jpg b/fiskeren.jpg | |
Binary files differ. | |
diff --git a/generate-readme.sh b/generate-readme.sh | |
t@@ -0,0 +1,55 @@ | |
+#!/bin/bash | |
+ | |
+# Pass README output file name as argument | |
+ | |
+HEADER="cross-stitch | |
+============ | |
+ | |
+A Python application to turn your images into patterns for cross stitching. | |
+ | |
+https://github.com/anders-dc/cross-stitch | |
+ | |
+Requirements | |
+------------ | |
+Python 2 or 3, Numpy, Scipy, and Matplotlib. | |
+ | |
+To install these dependencies in Debian and its derivatives, run: | |
+ | |
+ $ sudo apt-get install python python-numpy python-scipy python-matplotlib | |
+ | |
+License | |
+------- | |
+GNU Public License version 3 or newer. See LICENSE.txt for details. | |
+ | |
+Author | |
+------ | |
+Anders Damsgaard ([email protected]) | |
+ | |
+Usage | |
+----- | |
+ | |
+ " | |
+ | |
+echo "Generating $1" | |
+echo "$HEADER" > $1 | |
+echo ./cross-stitch.py -h >> $1 | |
+ | |
+EXAMPLE=" | |
+Example | |
+------- | |
+ | |
+ $ ./cross-stitch.py -i fiskeren.jpg -o fisker-pattern.py -w 50 | |
+ | |
+.. image:: fiskeren.jpg | |
+ :scale: 50 % | |
+ :alt: Original image | |
+ :align: left | |
+ | |
+.. image:: fisker-pattern.png | |
+ :scale: 60 % | |
+ :alt: Cross stitching pattern | |
+ :align: right | |
+ | |
+" | |
+ | |
+echo "$EXAMPLE" >> $1 |