Skip to main content

ipolypad

Convert an image or SVG into a padded polygon hull suitable for CSS shape-outside and HTML/canvas text-wrap engines. Reference implementation. Positive padding dilates the silhouette; negative padding erodes it.

See the project root README.md and SPEC.md for the full design. This package is the Python side — smart, batteries-included, multi-format output.

Install

uvx ipolypad trace dragon.svg --pad 6 --max-points 32 --out dragon.json
# or
uv pip install ipolypad

CLI

ipolypad trace <src> [--size 200] [--pad 6] [--max-points 32] \
                     [--hull / --no-hull] [--format json,css,svg,png,html] \
                     [--enhance / --no-enhance] [--bg-tolerance 12] \
                     [--selector .figure] [--out path]

ipolypad batch '*.svg' --out-dir dist/ [trace options...]

src may be a local path, an http(s):// URL, or a data: URL.

Library

from ipolypad import trace

result = trace("dragon.svg", size=200, pad=6, max_points=32, format="json")
print(result["points"])

Output

Default JSON:

{
  "src": "dragon.svg",
  "raster": { "width": 200, "height": 200, "pad": 6 },
  "max_points": 32,
  "n_points": 18,
  "points": [[0.500000, 0.020000], ...]
}

points are normalized 0..1 against the rasterization box, six decimals, no trailing closing vertex (polygon is implicitly closed).

License

Apache-2.0. See LICENSE.

Release files for ipolypad 1.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ipolypad 1.0.9
File Size Uploaded
ipolypad-1.0.9.tar.gz 13.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ipolypad 1.0.9
File Interpreter ABI Platform
ipolypad-1.0.9-py3-none-any.whl Python 3 none any Details

Total release size: 31.1 kB

Release files / ipolypad-1.0.9.tar.gz

Download URL ipolypad-1.0.9.tar.gz
Size 13.8 kB
Tags Source
SHA-256 checksum
How to use checksums
184ab8a446d5c61e007bde8e95786dcce6f17d591e36169155d92829fbc7e487
BLAKE2b-256 checksum
How to use checksums
1ac53a427da3ef39bf87a530710293b1430329ae845b04be869ede7cb937d881
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / ipolypad-1.0.9-py3-none-any.whl

Download URL ipolypad-1.0.9-py3-none-any.whl
Size 17.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
df4691305e2f55c75ff86b5fc4a1309c37ac944da7623810edaa9ed423d95def
BLAKE2b-256 checksum
How to use checksums
8ee8c976170856376d7ccebdd9313ef3130618d997d3468513217ca408b0542c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

1.0.9 This release

2 release files

1.0.8

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.2

2 release files

1.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page