Metadata-Version: 2.1
Name: pyanchorknit
Version: 0.1.1
Summary: Weaving algorithm.
Home-page: https://github.com/CrossNox/pyanchorknit
License: MIT
Author: CrossNox
Author-email: ijmermet@gmail.com
Requires-Python: >=3.7,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Artistic Software
Requires-Dist: opencv-python (>=4.5.3,<5.0.0)
Requires-Dist: scikit-image (>=0.18.3,<0.19.0)
Requires-Dist: tqdm (>=4.62.3,<5.0.0)
Requires-Dist: typer (>=0.4.0,<0.5.0)
Project-URL: Repository, https://github.com/CrossNox/pyanchorknit
Description-Content-Type: text/markdown

# PyAnchorKnit
Inspired by the work of [Petros Vrellis](https://www.instagram.com/pvrellis/). Based on [Weaver](https://github.com/alyyousuf7/Weaver).

## Installation
Usage of [pipx](https://pypa.github.io/pipx/) is encouraged.

```bash
pipx install pyanchorknit
```

## Example usage
```bash
pyanchorknit imgs/Johannes-Vermeer-Girl-With-a-Pearl-Earring.jpg --n-jobs 16 --n-edges 512 --maxlines 2000 --img-out imgs/
```

### Output image
![Girl with a Pearl Earring](imgs/Johannes-Vermeer-Girl-With-a-Pearl-Earring-weave.png)

### Output JSON
```json
{
  "points": {
    "0": [
      799,
      400
    ],
    "1": [
      682,
      682
    ],
    ...,
    "7": [
      682,
      117
    ]
  },
  "traces_json": [
    [
      [
        0,
        4
      ],
      145236
    ],
    [
      [
        4,
        1
      ],
      113064
    ],
    ...,
    [
      [
        2,
        6
      ],
      130755
    ]
  ]
}
```

Which indicates the position of anchor points and traces (along with their distance).

# Dev install
## Poetry
### Install poetry
```bash
pipx install poetry
```

### Install the project
```bash
poetry install
```

## Install [pre-commit](https://pre-commit.com) hooks
```bash
poetry run pre-commit install
poetry run pre-commit install -t pre-push
```

## Publish
```bash
poetry publish --build
```

