Skip to content

takes a bitmap and turns it into a knitting pattern

License

Notifications You must be signed in to change notification settings

etene/pixel-knitter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published