Skip to main content

Weaving algorithm.

Project description

PyAnchorKnit

Inspired by the work of Petros Vrellis. Based on Weaver.

Installation

Prerequisites

pyanchorknit uses pycairo, which requires pkg-config and cairo. Check here for installation commands for your platform.

Install pyanchorknit

Usage of pipx is encouraged.

pipx install pyanchorknit

Example usage

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

Output image

drawing

Output JSON

{
  "points": {
    "0": [
      799,
      400
    ],
    "1": [
      682,
      682
    ],
    ...,
    "7": [
      682,
      117
    ]
  },
  "traces": [
    [
      [
        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

pipx install poetry

Install the project

poetry install

Install pre-commit hooks

poetry run pre-commit install
poetry run pre-commit install -t pre-push

Publish

poetry publish --build

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyanchorknit-0.3.0.tar.gz (5.7 kB view hashes)

Uploaded Source

Built Distribution

pyanchorknit-0.3.0-py3-none-any.whl (6.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page