TextileDrawingMachine/contours
eumorpurgo 1168415cda
Update Readme.md
2018-03-17 15:56:15 +01:00
..
output Initial commit 2018-03-15 19:51:25 +01:00
src Initial commit 2018-03-15 19:51:25 +01:00
Readme.md Update Readme.md 2018-03-17 15:56:15 +01:00
picture2gcode.py Initial commit 2018-03-15 19:51:25 +01:00
requirements.txt Initial commit 2018-03-15 19:51:25 +01:00

Readme.md

Picture2Gcode

You should use python3 to get a better result. Hd-smoothing option does not works well with python2.7.

Options

--input-path : path to a picture

--image-width-in-mm: allows to set a target width in millimeter.

--hd-smoothing : increase resolution and help getting a better result, should be enbaled.

--tool-diameter-in-mm : used inly when filling shapes.

--fill : choose among 'no-fill', 'fill-in', 'auto-fill':
          'no-fill' : just contours. Input a black and white image.
          'fill-in' : always fill shapes. Input a black and white image.
          'auto-fill' : fill blue-shapes (Red:0, Green:0, Blue>=127).
                        Draw contours of red-shapes (Red>=127, Green:0, Blue:0).

Example

Example fill

python3 contours.py --input-path /path/to/input/picture --image-width-in-mm 5000 --hd-smoothing --tool-diameter-in-mm 17 --fill fill-in

python2.7 contours.py --input-path /path/to/input/picture --image-width-in-mm 5000 --hd-smoothing --tool-diameter-in-mm 17 --fill fill-in

Input :

Input Image

Output :

Output Image

Example contours only

python3 contours.py --input-path /path/to/input/picture --image-width-in-mm 5000 --hd-smoothing --tool-diameter-in-mm 17 --fill no-fill

python2.7 contours.py --input-path /path/to/input/picture --image-width-in-mm 5000 --hd-smoothing --tool-diameter-in-mm 17 --fill no-fill

Input :

Input Image

Output :

Inline-style: Output Image

Example auto fill

python3 contours.py --input-path /path/to/input/picture --image-width-in-mm 5000 --hd-smoothing --tool-diameter-in-mm 17 --fill auto-fill

python2.7 contours.py --input-path /path/to/input/picture --image-width-in-mm 5000 --hd-smoothing --tool-diameter-in-mm 17 --fill auto-fill

Input :

Input Image

Output :

Output Image

TODO

  • Adding initial erode
  • If Blue-->contours, if Red-->fill
  • Changing actions in putToolDown() and putToolUp