texture-generator
Generate random material textures with Python: metal, plastic, wood and paper, as Pillow images or NumPy arrays. Choose a size and seed to create a reproducible texture, then save it as a PNG. Generation runs locally using NumPy and Pillow, without models, downloaded assets or network access.
Installation
Requires Python 3.14 or later.
pip install texture-generator
The distribution is named texture-generator; the Python import is
texture_generators, and the command-line program is texture-gen.
Installation includes NumPy, Pillow and Click (used by the CLI).
Quickstart
from texture_generators import generate
image = generate("wood", size=(640, 480), seed=42, variant="board")
image.save("wood.png")
print(image.mode, image.size)
# RGB (640, 480)
This writes wood.png in the current directory. Sizes are (width, height);
an integer such as size=512 creates a square. Both dimensions must be at least
2 pixels. The same arguments reproduce the same image with the same package,
dependency versions and platform. Omit seed for a fresh texture.
For raw pixels or a labelled sheet of every variant:
from texture_generators import generate_array, sample_sheet
pixels = generate_array("metal", size=256, seed=7, variant="brushed")
print(pixels.shape, pixels.dtype)
# (256, 256, 3) float32
sheet = sample_sheet(size=128, seed=7)
sheet.save("materials.png")
Arrays contain RGB values in [0, 1]. The
API reference
covers all public functions and material parameters.
Command line
texture-gen wood --variant board --size 640x480 --seed 42 -o wood.png
texture-gen list
texture-gen sheet --size 128 --seed 7 -o materials.png
texture-gen wood --help
python -m texture_generators runs the same CLI. It also supports batches,
JSON reports, shell completion and browser galleries for comparing seeds and
parameters. See the
CLI reference.
Materials
| Material | Variants |
|---|---|
| Metal | brushed, radial, polished, heat_tinted, oil_film, anodised_titanium, engine_turned |
| Plastic | glossy, matte, textured |
| Wood | board, planks |
| Paper | white, kraft, recycled, newsprint, laid, coated |
The generators combine noise, material anatomy and lighting. Albedo, height and
roughness share underlying fields so visible features also affect shading.
These are procedural approximations with documented calibration assumptions.
Metal, plastic and wood do not tile seamlessly; paper tiles when creases are
disabled with creases=0.0.
Read the technical reference for the algorithms, wood and paper models, core modules, performance estimates and limitations. See the changelog for changes and GitHub issues to report a bug.
Development
Install uv, then:
git clone https://github.com/nmpowell/texture-generator.git
cd texture-generator
uv sync --locked
uv run pytest
uv run ruff check .
uv run ruff format --check .
uv sync --locked installs the project editable and uses the committed lockfile.
Use uv run ruff format . to apply formatting. The tests exercise rendering,
determinism, material physics, the CLI and built-package contents. Internal mypy
checks have existing findings and are informational; see the
development notes.
The version lives in pyproject.toml; texture_generators.__version__ reads
the installed package metadata. The
release guide
covers artifact checks and Trusted Publishing.
License
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file texture_generator-0.3.0.tar.gz.
File metadata
- Download URL: texture_generator-0.3.0.tar.gz
- Upload date:
- Size: 279.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fbe9dbfd7deae5379d82fea34ff07ba5f41287fed0329e008f7f256eed66f0b9
|
|
| MD5 |
cc953ea7b66f700e7e309f86c9c31c81
|
|
| BLAKE2b-256 |
a1cd8a385d1a7f9cbd191f6b6c4c87b799253333061efa7be59691d101d9efbd
|
Provenance
The following attestation bundles were made for texture_generator-0.3.0.tar.gz:
Publisher:
publish.yml on nmpowell/texture-generator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
texture_generator-0.3.0.tar.gz -
Subject digest:
fbe9dbfd7deae5379d82fea34ff07ba5f41287fed0329e008f7f256eed66f0b9 - Sigstore transparency entry: 2755448978
- Sigstore integration time:
-
Permalink:
nmpowell/texture-generator@87ebb8077e6f04b2b1bf6e3adb4639a8ebb84ce8 -
Branch / Tag:
refs/tags/0.3.0 - Owner: https://github.com/nmpowell
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@87ebb8077e6f04b2b1bf6e3adb4639a8ebb84ce8 -
Trigger Event:
release
-
Statement type:
File details
Details for the file texture_generator-0.3.0-py3-none-any.whl.
File metadata
- Download URL: texture_generator-0.3.0-py3-none-any.whl
- Upload date:
- Size: 153.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9efa6138ce01a2d01d15c4df9545fb04226e179bd4ccc159b1b579f551c13dd4
|
|
| MD5 |
dc98d04f051dfce0823dac8ebad62c7a
|
|
| BLAKE2b-256 |
36cbdcf58660b68d79e28462f58355b63bc37064d9b2d4f115dea6cd426b3280
|
Provenance
The following attestation bundles were made for texture_generator-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on nmpowell/texture-generator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
texture_generator-0.3.0-py3-none-any.whl -
Subject digest:
9efa6138ce01a2d01d15c4df9545fb04226e179bd4ccc159b1b579f551c13dd4 - Sigstore transparency entry: 2755449055
- Sigstore integration time:
-
Permalink:
nmpowell/texture-generator@87ebb8077e6f04b2b1bf6e3adb4639a8ebb84ce8 -
Branch / Tag:
refs/tags/0.3.0 - Owner: https://github.com/nmpowell
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@87ebb8077e6f04b2b1bf6e3adb4639a8ebb84ce8 -
Trigger Event:
release
-
Statement type: