Skip to content

bmad4ever/bmquilting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

379 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bmquilting

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.

Features

  • 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.

Synthesis Examples

📸 Click to expand example section

Texture Transfer

Input Target Input Texture Output
Target Texture Output
Target Texture Output
Target Texture Output

Hole Filling

Input Seams Output
Input Seams Output
Input Seams Output
Input Seams Output

Proxy Synthesis

Input (Noisy) Proxy (Blurred) Output
Input Proxy Output
Input Proxy Output
Input Proxy Output

Texture Generation

Input Seams Output
Input Seams Output
Input Seams Output
Input Seams Output

Make Texture Tile-able

Input Output Tiled 2x2
Input Output Tiled
Input Output Tiled
Input Output Tiled

Requirements

  • Python 3.12 or higher
  • See pyproject.toml for full dependency list

Installation

Install directly from source:

# Basic installation
pip install .

# With Numba acceleration (improves certain internals; overall speedup is typically 1–6%)
pip install .[fast]

Documentation

Resource Description
Main Documentation Index Full API reference and overview
Quick Start Guide Examples including circular patching and inpainting
Arguments Explained Deep dive into block size, overlap, and tolerance
Advanced Configuration Fine-tuning blending kernels and seam algorithms
Demo Scripts Runnable examples for synthesis and utility functions

Licence

This project is distributed under MIT licence.

Used by

Contributors

Languages