bmquilting is a Python library for texture synthesis based on image quilting algorithms. It synthesises new textures from small source samples by intelligently stitching patches together.
- Dual Grid and Patch Shape Support: Square patches on a cartesian grid, or circular patches over a hexagonal lattice.
- Multiple Stitching Modes: Seams, blurred seams, feathering, or hybrid stitching solutions.
- Adaptive Seam Blending: Dynamically adjusts blur intensity based on local gradient differences to conceal transitions.
- Proxy Synthesis: Match patches using simplified proxies (blurred, downscaled, etc.) whilst reconstructing with full-resolution detail.
- Seamless Tiling: Built-in functions to make any texture tileable.
- Hole Filling: Inpaint textures with missing or masked-out regions.
- Texture Transfer: Transfer the texture of one object onto another, or create a textured stencil of a subject.
- Incomplete References: Mark invalid sections of a source image; the library will still make partial use of them during synthesis.
- Parallel Generation: Multi-process variants of synthesis functions for faster throughput.
- Block Size Heuristics (Experimental): Automatically estimate a suitable patch size using FFT or SIFT descriptor distributions.
📸 Click to expand example section
| Input Target |
Input Texture |
Output |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| Input (Noisy) |
Proxy (Blurred) |
Output |
 |
 |
 |
 |
 |
 |
 |
 |
 |
- Python 3.12 or higher
- See
pyproject.toml for full dependency list
Install directly from source:
# Basic installation
pip install .
# With Numba acceleration (improves certain internals; overall speedup is typically 1–6%)
pip install .[fast]
This project is distributed under MIT licence.