etene / pixel-knitter

takes a bitmap and turns it into a knitting pattern

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pixel Knitter

pixel-knitter takes a bitmap and turns it into a knitting pattern.

The output is written to stdout in self-contained html format. It does only one thing; if you need other formats, html can be converted to pretty much everything.

Usage

usage: pixel-knitter [-h] [-s {horizontal,vertical}] image

Turn a bitmap (like a PNG image) into a knitting/tricot pattern.

positional arguments:
  image                 The image to get pixels from, - for stdin.
options:
  -h, --help            show this help message and exit
  -s {horizontal,vertical}, --streak-mode {horizontal,vertical}
                        Whether to label continuous streaks of the same color horizontally or vertically.

Recipes

Generate a HTML file

pixel-knitter -s vertical image.png > generated.html

Generate a PDF

pixel-knitter -s vertical image.png | wkhtmltopdf - generated.pdf

Generate a PNG

pixel-knitter -s vertical image.png | wkhtmltoimage --format png - generated.png

Display the pattern in the terminal using sixels

Needs a compatible terminal.

pixel-knitter -s vertical image.png | wkhtmltoimage --format png - -  | img2sixel

About

takes a bitmap and turns it into a knitting pattern

License:Do What The F*ck You Want To Public License


Languages

Language:Python 73.8%Language:HTML 26.2%