Skip to main content

A truchet tiles generator

Creates a truchet pattern as a PNG bitmap.

Install

pip install truchet-tiling

Usage

import truchet_tiling.truchet_pattern as tp
from truchet_tiling.themes import RED_FLAMES 

image = tp.generate(
    width=700,
    height=500,
    colors = RED_FLAMES,
    directions='mixed',
    arcs_probability=1,
    stroke_color=0xFFFFFF,
    stroke_width=6
)

To try it in Jupyter Notebook:

import truchet_tiling.truchet_pattern as tp

# helper to display bitmap images
def display_image(image_bytes):
  from IPython.display import display, Image as IPImage
  display(IPImage(data=image_bytes.getvalue()))

image = tp.generate(width=800, height=600)
display_image(image)

Parameters:
width (int): Minimal width of the pattern.
height (int): Minimal height of the pattern.
cell_size (int): Size of the cell in the pattern.
arcs_probability (float): Probability of arcs in the pattern. Accepted float values in the range [0, 1].
directions (str): Direction of the pattern. Accepted values are ['mixed', 'horizontal', 'vertical'].
colors (List[int]): List of colors to use in the pattern. With Null a random color set will be used.
stroke_color (int): Color of the strokes.
stroke_width (int): Width of the strokes.

Metadata

Release files for truchet-tiling 0.0.32

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

Source distribution (sdist)

Source distribution for truchet-tiling 0.0.32
File Size Uploaded
truchet_tiling-0.0.32.tar.gz 11.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for truchet-tiling 0.0.32
File Interpreter ABI Platform
truchet_tiling-0.0.32-py3-none-any.whl Python 3 none any Details

Total release size: 29.9 kB

Release files / truchet_tiling-0.0.32.tar.gz

Download URL truchet_tiling-0.0.32.tar.gz
Size 11.4 kB
Tags Source
SHA-256 checksum
How to use checksums
629be0558d89c00449880c804491aac9b2fb0f5e776319dc9185cd699e9a5b41
BLAKE2b-256 checksum
How to use checksums
c1cd1f969176ec4356b62510c783f64c680245cc2603a1cd8bee288e306ec426
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.7

Release files / truchet_tiling-0.0.32-py3-none-any.whl

Download URL truchet_tiling-0.0.32-py3-none-any.whl
Size 18.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
13aa17f8c1843c601b1d34a80016c5dbedb0172649ca3297fc7b0d4979746435
BLAKE2b-256 checksum
How to use checksums
8a01cc57d31732bb0fe69edcd0c33e5926f2bf350cb39f88483f3e6872b40bac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.7

Release history Release notifications | RSS feed

This release

0.0.32 This release

2 release files

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