Repository navigation
Releases
loomwork v0.6.0
loomwork v0.6.0 adds three opt-in companion maps: --normal, --roughness and --ao. Default output is unchanged.
--normal OUT.pngwrites a tangent-space normal map (+Y up) derived from the weave's height field with wrapped differences, so it tiles exactly.--strengthscales the slope.--roughness OUT.png(with--rough-range LO HI) and--ao OUT.png(with--ao-radius) write 8-bit grey companion maps from the same height field; both tile exactly.- CI now runs the new tests on Pillow 10.4.0, 11.3.0 and latest.
Limits, plainly:
- The height field is a model of the weave, not measured geometry. The maps have not been viewed in a real renderer.
- Normal vectors are only approximately unit length: the worst error measured was 1.52/255 (6 seeds, size 64).
- Not supported with
--sheetor SVG output names; clashing output names are refused. - Default output was byte-identical to the previous version in every combination compared (seeds, weaves, sizes, periodic or not).
- No issues or reports of outside use so far.
loomwork v0.5.0
loomwork v0.5.0 adds --periodic: a tile with no doubled line at the joins.
- The default cloth is mirrored, so the first and last lines are equal and tiling repeats one line at each join (and, at even sizes, down the middle of the tile). That is unchanged and still documented as a known limit. With
--periodicthe mirror lines fall on line 0 and the middle line instead, so the last line equals line 1 and no line is repeated at a join. At odd sizes the middle of the tile still has one doubled line. Neighbouring lines can still be equal by chance. The tile is still mirror-symmetric inside. - The same seed gives a different cloth with
--periodicthan without it. Output without the flag is byte-identical to v0.4.0 (compared on PNG, SVG, preview, sheet and the gallery and samples). python3 -I tools/check_tiling.py --periodicchecks the reflection and the middle line; the 600-combination run passed on the release commit, and mutants that break only the middle line make it fail. CI runs it on the latest Pillow.--periodicworks with--weave,--palette-from,--sheet,--previewand SVG output.- The README, tutorial, field note and essay pages mention it.
Known limits: the tiling check for the periodic variant runs in CI on one Pillow version (latest); nobody outside has used the option.
loomwork v0.4.0
loomwork v0.4.0 adds --palette-from IMAGE: use up to 5 dominant colours of a picture as the palette.
- Colours are found by median cut on the image shrunk to fit 128 by 128 pixels, and sorted dark to light. They are printed as
palette: #rrggbb,..., so you can reuse them with--palette. For photographs the colours are approximate and can differ between Pillow versions. They are exact only for images of up to 5 flat colours that are no larger than 128 pixels on a side; larger images are shrunk first, and blending at colour edges can add or shift a colour. - The alpha channel is dropped (transparent pixels count with the colour stored for them), and an animated image uses its first frame. An image with fewer than 2 distinct colours, an unreadable file, or using
--palettetogether with--palette-fromis refused with exit code 2 and writes nothing. python3 -I tools/palettecheck.pychecks the option on flat-colour images made on the spot, and CI runs it. Output without--palette-fromis byte-identical to v0.3.0 (checked by cmp on PNG, SVG, preview and sheet output, and selfcheck).
CI (Python 3.12, Pillow 10.4.0, 11.3.0 and 13.0.0) passed selfcheck and palettecheck on the release commit; the job logs were read.
Known limits: only those Pillow versions were tested; no real-photo palette is pinned by a test; nobody outside has used it.
loomwork v0.3.0
loomwork v0.3.0 adds --weave, a choice of pattern family: auto (the default; the seed picks one of three exactly as before, so existing seeds give the same files), twill, basket or mixed.
- The other choices a seed makes (colours, band widths, stitch) stay the same in every family. For some seeds two weaves give identical pixels.
- Every weave is mirrored, so opposite edges match. The tiling check takes
--weave NAME(python3 -I tools/check_tiling.py --weave basket); each weave's 600-combination run passed, and each run takes a few minutes. - Works with
--sheet,--previewand SVG output. Output without--weaveis byte-identical to v0.2.1 in 4800 compared cases and for the gallery and samples.
Known limits: only Pillow versions listed in the README's CI range were tested; the per-weave tiling sweep was run on one local Pillow version.
loomwork v0.2.1
SVG output now refuses files larger than about 32 MiB (exit code 2, nothing written). Before, a 4096 px SVG could reach about 293 MB depending on the seed. Gallery SVGs are byte-identical to v0.2.0. README explains the limit.
loomwork v0.2.0
loomwork v0.2.0
New since v0.1.0
- SVG output: give
--out(or--preview) a name ending in.svg. One rect per horizontal run of same-coloured pixels, no metadata. SVG files are much larger than PNG (about 31 KB for a 32-pixel cloth; at size 4096 measured about 10 MB for seed 1 and about 293 MB for seed 7, so size depends on the seed), so keep--sizesmall.--sheetwrites PNG only. tools/svgcheck.py: draws the SVG with a small built-in rasteriser and compares it with the PNG pixels for the 12 gallery cloths, and checks that reruns are byte-identical.tools/examples/wrap_gen.py: a third example generator for the tiling checker (opposite edges match; the checker passes on it).- README: tested Pillow versions stated, link to releases.
Unchanged
- Same seed and flags give the same image (pixels; file bytes can differ between Pillow versions).
tools/selfcheck.sh(about 7 seconds on the machine used for the test; exit 0 pass, 1 fail, 2 cannot run) andtools/check_tiling.py(full check, 600 combinations).- CI runs
selfcheck.shon Python 3.12 with Pillow 10.4.0, 11.3.0 and the latest release (13.0.0 at the time of release), and confirms it fails on a deliberately broken fixture.
Known limits
- Only those Pillow versions were tested; older ones are untested.
- SVG was checked with a small built-in rasteriser only, not in a browser or other SVG renderer.
- The label font on
--sheetcomes from Pillow's default and may differ between versions.
loomwork v0.1.0
loomwork v0.1.0 — a seeded generator for seamless woven-cloth PNGs.
What it does
- Same seed and flags give the same image (pixels; file bytes can differ between Pillow versions).
- Tiles seamlessly: opposite edges match.
- Built-in palettes or your own with
--palette;--previewwrites a tiled preview. --sheet Nrenders N consecutive seeds into one labelled contact sheet (N up to 64).
Checks that ship with it
tools/selfcheck.sh: about 7 seconds on the machine used for the test; regenerates the gallery, compares pixels, runs a reduced tiling check. Exit 0 pass, 1 fail, 2 cannot run.tools/check_tiling.py: the full tiling check, 600 combinations (a couple of minutes).- CI runs
selfcheck.shon Python 3.12 with Pillow 10.4.0, 11.3.0 and the latest release (13.0.0 at the time of release), and confirms it fails on a deliberately broken fixture.
Install: needs Python 3 and Pillow (python3 -m pip install Pillow); no other dependencies. See the README for commands.
Known limits
- Only the Pillow versions above were tested; older ones are untested.
- The label font on
--sheetcomes from Pillow's default and may differ between versions. - Gallery images are compared by pixels, not file bytes.