Noisemaker API¶
Images are float32 tensors (0..1 range), with shape (height, width, channels). Most functions assume seamlessly tiled noise.
This is a pre-1.0 API, and may receive backwards incompatible changes.
noisemaker.generators¶
High-level noise generation functions.
Noise generation interface for Noisemaker
- noisemaker.generators.basic(freq: int | list[int], shape: list[int], ridges: bool = False, sin: float = 0.0, spline_order: InterpolationType = InterpolationType.bicubic, distrib: ValueDistribution = ValueDistribution.simplex, corners: bool = False, mask: ValueMask | None = None, mask_inverse: bool = False, mask_static: bool = False, lattice_drift: float = 0.0, color_space: ColorSpace = ColorSpace.hsv, hue_range: float = 0.125, hue_rotation: float | None = None, saturation: float = 1.0, hue_distrib: ValueDistribution | None = None, brightness_distrib: ValueDistribution | None = None, brightness_freq: int | list[int] | None = None, saturation_distrib: ValueDistribution | None = None, speed: float = 1.0, time: float = 0.0, octave_effects: list[Callable] | None = None, octave: int = 1) Tensor[source]¶
Generate a single layer of scaled noise.
Rendering...- Parameters:
freq – Base noise frequency. Int, or list of ints for each spatial dimension
shape – Shape of noise. For 2D noise, this is [height, width, channels]
ridges – “Crease” at midpoint values: (1 - abs(n * 2 - 1))
sin – Apply sin function to noise basis
spline_order – Spline point count. 0=Constant, 1=Linear, 2=Cosine, 3=Bicubic
distrib – Type of noise distribution. See
ValueDistributionenumcorners – If True, pin values to corners instead of image center
mask – Optional mask to apply
mask_inverse – Invert the mask
mask_static – If True, don’t animate the mask
lattice_drift – Push away from underlying lattice
color_space – Color space to use (HSV, RGB, etc)
hue_range – HSV hue range
hue_rotation – HSV hue bias
saturation – HSV saturation
hue_distrib – Override ValueDistribution for hue
saturation_distrib – Override ValueDistribution for saturation
brightness_distrib – Override ValueDistribution for brightness
brightness_freq – Override frequency for brightness
speed – Displacement range for Z/W axis (simplex and periodic only)
time – Time argument for Z/W axis (simplex and periodic only)
octave_effects – Effects to apply per octave
octave – Current octave number
- Returns:
Generated noise tensor
- noisemaker.generators.multires(preset, seed: int, freq: int | list[int] = 3, shape: list[int] | None = None, octaves: int = 1, ridges: bool = False, sin: float = 0.0, spline_order: InterpolationType = InterpolationType.bicubic, distrib: ValueDistribution = ValueDistribution.simplex, corners: bool = False, mask: ValueMask | None = None, mask_inverse: bool = False, mask_static: bool = False, lattice_drift: float = 0.0, with_supersample: bool = False, color_space: ColorSpace = ColorSpace.hsv, hue_range: float = 0.125, hue_rotation: float | None = None, saturation: float = 1.0, hue_distrib: ValueDistribution | None = None, saturation_distrib: ValueDistribution | None = None, brightness_distrib: ValueDistribution | None = None, brightness_freq: int | list[int] | None = None, octave_blending: OctaveBlending = OctaveBlending.falloff, octave_effects: list[Callable] | None = None, post_effects: list[Callable] | None = None, with_alpha: bool = False, final_effects: list[Callable] | None = None, with_upscale: bool = False, with_fxaa: bool = False, time: float = 0.0, speed: float = 1.0, tensor: TypeAliasForwardRef('Tensor') | None = None) Tensor[source]¶
Generate multi-resolution value noise. For each octave: freq increases, amplitude decreases.
Rendering...- Parameters:
preset – The Preset object being rendered
seed – The generation seed to use
freq – Bottom layer frequency. Int, or list of ints for each spatial dimension
shape – Shape of noise. For 2D noise, this is [height, width, channels]
octaves – Octave count. Number of multi-res layers. Typically 1-8
ridges – Per-octave “crease” at midpoint values: (1 - abs(n * 2 - 1))
sin – Apply sin function to noise basis
spline_order – Spline point count. 0=Constant, 1=Linear, 2=Cosine, 3=Bicubic
distrib – Type of noise distribution. See
ValueDistributionenumcorners – If True, pin values to corners instead of image center
mask – Optional mask to apply
mask_inverse – Invert the mask
mask_static – If True, don’t animate the mask
lattice_drift – Push away from underlying lattice
with_supersample – Use x2 supersampling
color_space – Color space to use (HSV, RGB, etc)
hue_range – HSV hue range
hue_rotation – HSV hue bias
saturation – HSV saturation
hue_distrib – Override ValueDistribution for HSV hue
saturation_distrib – Override ValueDistribution for HSV saturation
brightness_distrib – Override ValueDistribution for HSV brightness
brightness_freq – Override frequency for HSV brightness
octave_blending – Method for flattening octave values
octave_effects – A list of composer lambdas to invoke per-octave
post_effects – A list of composer lambdas to invoke after flattening layers
with_alpha – Include alpha channel
final_effects – A list of composer lambdas to invoke after everything else
with_upscale – AI: x2 upscale final results
with_fxaa – Apply FXAA to results
speed – Displacement range for Z/W axis (simplex and periodic only)
time – Time argument for Z/W axis (simplex and periodic only)
tensor – Optional input tensor to start with
- Returns:
Generated multi-resolution noise tensor
noisemaker.effects¶
Image effect and post-processing functions.
Low-level effects library for Noisemaker
- noisemaker.effects.erosion_worms(tensor: Tensor, shape: list[int], density: float = 50, iterations: int = 50, contraction: float = 1.0, quantize: bool = False, alpha: float = 0.25, inverse: bool = False, xy_blend: bool = False, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
WIP hydraulic erosion effect.
Rendering...- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
density – Feature density
iterations – Number of iterations to perform
contraction – Contraction amount
quantize – Quantize output colors
alpha – Blending alpha value (0.0-1.0)
inverse – Invert the effect
xy_blend – XY blend amount
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.reindex(tensor: Tensor, shape: list[int], displacement: float = 0.5, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
Re-color the given tensor, by sampling along one axis at a specified frequency.
Rendering...- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
displacement – Displacement amount
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Processed tensor
- noisemaker.effects.ripple(tensor: Tensor, shape: list[int], freq: int | list[int] = 2, displacement: float = 1.0, kink: float = 1.0, reference: TypeAliasForwardRef('Tensor') | None = None, spline_order: int | InterpolationType = InterpolationType.bicubic, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
Apply displacement from pixel radian values.
Rendering...- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
freq – Noise frequency
displacement – Displacement amount
kink – Displacement kink amount
reference – Reference tensor for comparison
spline_order – Interpolation type for resampling
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.color_map(tensor: Tensor, shape: list[int], clut: TypeAliasForwardRef('Tensor') | str | None = None, horizontal: bool = False, displacement: float = 0.5, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
Apply a color map to an image tensor. The color map can be a photo or whatever else.
Rendering...- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
clut – Color lookup table
horizontal – Apply horizontally (vs vertically)
displacement – Displacement amount
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.worms(tensor: Tensor, shape: list[int], behavior: int | WormBehavior = 1, density: float = 4.0, duration: float = 4.0, stride: float = 1.0, stride_deviation: float = 0.05, alpha: float = 0.5, kink: float = 1.0, drunkenness: float = 0.0, quantize: bool = False, colors: TypeAliasForwardRef('Tensor') | None = None, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
Make a furry patch of worms which follow field flow rules.
Rendering...- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
behavior – Worm behavior mode
density – Feature density
duration – Effect duration
stride – Movement stride length
stride_deviation – Stride randomization amount
alpha – Blending alpha value (0.0-1.0)
kink – Displacement kink amount
drunkenness – Random walk amount
quantize – Quantize output colors
colors – Optional color tensor for rendering
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.wormhole(tensor: Tensor, shape: list[int], kink: float = 1.0, input_stride: float = 1.0, alpha: float = 1.0, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
Apply per-pixel field flow. Non-iterative.
Rendering...- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
kink – Displacement kink amount
input_stride – Input sampling stride
alpha – Blending alpha value (0.0-1.0)
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.derivative(tensor: Tensor, shape: list[int], dist_metric: int | DistanceMetric = DistanceMetric.euclidean, with_normalize: bool = True, alpha: float = 1.0, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
Extract a derivative from the given noise.
Rendering...- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
dist_metric – Distance metric to use
with_normalize – Normalize the output
alpha – Blending alpha value (0.0-1.0)
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.sobel_operator(tensor: Tensor, shape: list[int], dist_metric: int | DistanceMetric = DistanceMetric.euclidean, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
Apply a sobel operator.
Rendering...- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
dist_metric – Distance metric to use
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.normal_map(tensor: Tensor, shape: list[int], time: float = 0.0, speed: float = 1.0) Tensor[source]¶
Generate a tangent-space normal map.
Rendering...- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.density_map(tensor: Tensor, shape: list[int], time: float = 0.0, speed: float = 1.0) Tensor[source]¶
Create a binned pixel value density map.
Rendering...- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.jpeg_decimate(tensor: Tensor, shape: list[int], iterations: int = 25, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
Destroy an image with the power of JPEG
Rendering...- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
iterations – Number of iterations to perform
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.conv_feedback(tensor: Tensor, shape: list[int], iterations: int = 50, alpha: float = 0.5, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
Conv2d feedback loop
Rendering...- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
iterations – Number of iterations to perform
alpha – Blending alpha value (0.0-1.0)
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.blend_layers(control: list[tuple[TypeAliasForwardRef('Tensor'), float]], shape: list[int], feather: float = 1.0, *layers: Any) Tensor[source]¶
Blend multiple image layers based on a control tensor.
- Parameters:
control – Control tensor for blending
shape – Shape of the tensor [height, width, channels]
feather – Feathering amount for blending transitions
*layers – Variable number of layer tensors to blend
- Returns:
Modified tensor
- noisemaker.effects.center_mask(center: Tensor, edges: Tensor, shape: list[int], dist_metric: int | DistanceMetric = DistanceMetric.chebyshev, power: float = 2) Tensor[source]¶
Blend two image tensors from the center to the edges.
- Parameters:
center – Center point coordinates
edges – Edge handling mode
shape – Shape of the tensor [height, width, channels]
dist_metric – Distance metric to use
power – Power curve exponent
- Returns:
Processed tensor
- noisemaker.effects.posterize(tensor: Tensor, shape: list[int], levels: int = 9, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
Reduce the number of color levels per channel.
Rendering...- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
levels – Number of posterization levels
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.inner_tile(tensor: Tensor, shape: list[int], freq: int | list[int]) Tensor[source]¶
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
freq – Noise frequency
- Returns:
Modified tensor
- noisemaker.effects.expand_tile(tensor: Tensor, input_shape: list[int], output_shape: list[int], with_offset: bool = True) Tensor[source]¶
- Parameters:
tensor – Input tensor to process
input_shape – Shape of input tensor
output_shape – Shape of output tensor
with_offset – Apply offset to output
- Returns:
Modified tensor
- noisemaker.effects.offset_index(y_index: Tensor, height: int, x_index: Tensor, width: int) Tensor[source]¶
Offset X and Y displacement channels from each other, to help with diagonal banding. Returns a combined Tensor with shape [height, width, 2]
- Parameters:
y_index – Y coordinate indices
height – Height dimension
x_index – X coordinate indices
width – Width dimension
- Returns:
Processed tensor
- noisemaker.effects.warp(tensor: Tensor, shape: list[int], freq: int | list[int] = 2, octaves: int = 5, displacement: float = 1, spline_order: int | InterpolationType = InterpolationType.bicubic, warp_map: TypeAliasForwardRef('Tensor') | None = None, signed_range: bool = True, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
Multi-octave warp effect
Rendering...- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
freq – Noise frequency
octaves – Number of octave layers
displacement – Displacement amount
spline_order – Interpolation type for resampling
warp_map – Optional warp displacement map
signed_range – Use signed range (-1 to 1)
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.sobel(tensor: Tensor, shape: list[int], dist_metric: int | DistanceMetric = 1, rgb: bool = False) Tensor[source]¶
Colorized sobel edges.
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
dist_metric – Distance metric to use
rgb – Treat as RGB (vs grayscale)
- Returns:
Modified tensor
- noisemaker.effects.outline(tensor: Tensor, shape: list[int], sobel_metric: int | DistanceMetric = 1, invert: bool = False, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
Superimpose sobel operator results (cartoon edges)
Rendering...- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
sobel_metric – Distance metric for Sobel operator
invert – Invert the effect
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.glowing_edges(tensor: Tensor, shape: list[int], sobel_metric: int | DistanceMetric = 2, alpha: float = 1.0, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
- Rendering...
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
sobel_metric – Distance metric for Sobel operator
alpha – Blending alpha value (0.0-1.0)
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.vortex(tensor: Tensor, shape: list[int], displacement: float = 64.0, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
Vortex tiling effect
Rendering...- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
displacement – Displacement amount
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.aberration(tensor: Tensor, shape: list[int], displacement: float = 0.005, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
Chromatic aberration
Rendering...- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
displacement – Displacement amount
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.bloom(tensor: Tensor, shape: list[int], alpha: float = 0.5, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
Bloom effect Input image must currently be square (sorry).
Rendering...- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
alpha – Blending alpha value (0.0-1.0)
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.dla(tensor: Tensor, shape: list[int], padding: int = 2, seed_density: float = 0.01, density: float = 0.125, xy: tuple[TypeAliasForwardRef('Tensor'), TypeAliasForwardRef('Tensor'), int] | None = None, alpha: float = 1.0, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
Diffusion-limited aggregation. Renders with respect to the time param (0..1)
Rendering...- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
padding – Edge padding amount
seed_density – Density of seed points
density – Feature density
xy – Optional XY coordinates for point cloud
alpha – Blending alpha value (0.0-1.0)
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.wobble(tensor: Tensor, shape: list[int], time: float = 0.0, speed: float = 1.0) Tensor[source]¶
Move the entire image around
Rendering...- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.reverb(tensor: Tensor, shape: list[int], octaves: int = 2, iterations: int = 1, ridges: bool = True, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
Multi-octave “reverberation” of input image tensor
Rendering...- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
octaves – Number of octave layers
iterations – Number of iterations to perform
ridges – Apply ridge transformation
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.light_leak(tensor: Tensor, shape: list[int], alpha: float = 0.25, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
- Rendering...
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
alpha – Blending alpha value (0.0-1.0)
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.vignette(tensor: Tensor, shape: list[int], brightness: float = 0.0, alpha: float = 1.0, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
- Rendering...
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
brightness – Brightness adjustment
alpha – Blending alpha value (0.0-1.0)
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.vaseline(tensor: Tensor, shape: list[int], alpha: float = 1.0, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
- Rendering...
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
alpha – Blending alpha value (0.0-1.0)
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.shadow(tensor: Tensor, shape: list[int], alpha: float = 1.0, reference: TypeAliasForwardRef('Tensor') | None = None, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
Convolution-based self-shadowing effect.
Rendering...- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
alpha – Blending alpha value (0.0-1.0)
reference – Reference tensor for comparison
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.glyph_map(tensor: Tensor, shape: list[int], mask: ValueMask | None = None, colorize: bool = True, zoom: int = 1, alpha: float = 1.0, spline_order: InterpolationType = InterpolationType.constant, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
- Rendering...
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
mask – Value mask to apply
colorize – Apply colorization
zoom – Zoom factor
alpha – Blending alpha value (0.0-1.0)
spline_order – Interpolation type for resampling
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.pixel_sort(tensor: Tensor, shape: list[int], angled: bool | float = False, darkest: bool = False, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
Pixel sort effect
Rendering...- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
angled – Use angled sorting
darkest – Sort from darkest pixels
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.rotate(tensor: Tensor, shape: list[int], angle: float | None = None, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
Rotate the image. This breaks seamless edges.
Rendering...- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
angle – Rotation angle in radians
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.rotate2D(tensor: Tensor, shape: list[int], angle: float | None) Tensor[source]¶
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
angle – Rotation angle in radians
- Returns:
Modified tensor
- noisemaker.effects.sketch(tensor: Tensor, shape: list[int], time: float = 0.0, speed: float = 1.0) Tensor[source]¶
Pencil sketch effect
Rendering...- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.simple_frame(tensor: Tensor, shape: list[int], brightness: float = 0.0, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
- Rendering...
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
brightness – Brightness adjustment
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.lowpoly(tensor: Tensor, shape: list[int], distrib: int | PointDistribution | ValueDistribution = PointDistribution.random, freq: int | list[int] = 10, time: float = 0.0, speed: float = 1.0, dist_metric: int | DistanceMetric = DistanceMetric.euclidean) Tensor[source]¶
Low-poly art style effect
Rendering...- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
distrib – Distrib
freq – Noise frequency
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
dist_metric – Distance metric to use
- Returns:
Modified tensor
- noisemaker.effects.square_crop_and_resize(tensor: Tensor, shape: list[int], length: int = 1024) Tensor[source]¶
Crop and resize an image Tensor into a square with desired side length.
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
length – Length
- Returns:
Modified tensor
- noisemaker.effects.kaleido(tensor: Tensor, shape: list[int], sides: int = 6, sdf_sides: int = 5, xy: TypeAliasForwardRef('Tensor') | None = None, blend_edges: bool = True, time: float = 0.0, speed: float = 1.0, point_freq: int = 1, point_generations: int = 1, point_distrib: PointDistribution = PointDistribution.random, point_drift: float = 0.0, point_corners: bool = False) Tensor[source]¶
- Rendering...
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
sides – Number of polygon sides
sdf_sides – SDF polygon sides for distance metric
xy – Optional XY coordinates for point cloud
blend_edges – Blend with original edges
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
point_freq – Point frequency for Voronoi
point_generations – Point generation count
point_distrib – Point distribution method
point_drift – Point drift amount
point_corners – Include corner points
- Returns:
Modified tensor
- noisemaker.effects.palette(tensor: Tensor, shape: list[int], name: str | None = None, alpha: float = 1.0, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
Another approach to image coloration https://iquilezles.org/www/articles/palettes/palettes.htm
Rendering...- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
name – Name
alpha – Blending alpha value (0.0-1.0)
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.vhs(tensor: Tensor, shape: list[int], time: float = 0.0, speed: float = 1.0) Tensor[source]¶
Apply a bad VHS tracking effect.
Rendering...- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.lens_warp(tensor: Tensor, shape: list[int], displacement: float = 0.0625, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
- Rendering...
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
displacement – Displacement amount
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.lens_distortion(tensor: Tensor, shape: list[int], displacement: float = 1.0, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
- Rendering...
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
displacement – Displacement amount
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.degauss(tensor: Tensor, shape: list[int], displacement: float = 0.0625, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
- Rendering...
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
displacement – Displacement amount
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.crt(tensor: Tensor, shape: list[int], time: float = 0.0, speed: float = 1.0) Tensor[source]¶
Apply vintage CRT scanlines.
Rendering...- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.scanline_error(tensor: Tensor, shape: list[int], time: float = 0.0, speed: float = 1.0) Tensor[source]¶
- Rendering...
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.snow(tensor: Tensor, shape: list[int], alpha: float = 0.25, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
- Rendering...
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
alpha – Blending alpha value (0.0-1.0)
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.grain(tensor: Tensor, shape: list[int], alpha: float = 0.25, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
- Rendering...
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
alpha – Blending alpha value (0.0-1.0)
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.false_color(tensor: Tensor, shape: list[int], horizontal: bool = False, displacement: float = 0.5, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
- Rendering...
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
horizontal – Apply horizontally (vs vertically)
displacement – Displacement amount
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.fibers(tensor: Tensor, shape: list[int], time: float = 0.0, speed: float = 1.0) Tensor[source]¶
- Rendering...
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.scratches(tensor: Tensor, shape: list[int], time: float = 0.0, speed: float = 1.0) Tensor[source]¶
- Rendering...
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.stray_hair(tensor: Tensor, shape: list[int], time: float = 0.0, speed: float = 1.0) Tensor[source]¶
- Rendering...
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.grime(tensor: Tensor, shape: list[int], time: float = 0.0, speed: float = 1.0) Tensor[source]¶
- Rendering...
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.frame(tensor: Tensor, shape: list[int], time: float = 0.0, speed: float = 1.0) Tensor[source]¶
- Rendering...
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.texture(tensor: Tensor, shape: list[int], time: float = 0.0, speed: float = 1.0) Tensor[source]¶
- Rendering...
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.spooky_ticker(tensor: Tensor, shape: list[int], time: float = 0.0, speed: float = 1.0) Tensor[source]¶
- Rendering...
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.on_screen_display(tensor: Tensor, shape: list[int], time: float = 0.0, speed: float = 1.0) Tensor[source]¶
- Rendering...
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.nebula(tensor: Tensor, shape: list[int], time: float = 0.0, speed: float = 1.0) Tensor[source]¶
- Rendering...
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.spatter(tensor: Tensor, shape: list[int], color: bool = True, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
- Rendering...
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
color – Color
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.clouds(tensor: Tensor, shape: list[int], time: float = 0.0, speed: float = 1.0) Tensor[source]¶
Top-down cloud cover effect
Rendering...- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.tint(tensor: Tensor, shape: list[int], time: float = 0.0, speed: float = 1.0, alpha: float = 0.5) Tensor[source]¶
- Rendering...
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
alpha – Blending alpha value (0.0-1.0)
- Returns:
Modified tensor
- noisemaker.effects.adjust_hue(tensor: Tensor, shape: list[int], amount: float = 0.25, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
- Rendering...
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
amount – Amount
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.adjust_saturation(tensor: Tensor, shape: list[int], amount: float = 0.75, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
- Rendering...
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
amount – Amount
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.adjust_brightness(tensor: Tensor, shape: list[int], amount: float = 0.125, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
- Rendering...
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
amount – Amount
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.adjust_contrast(tensor: Tensor, shape: list[int], amount: float = 1.25, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
- Rendering...
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
amount – Amount
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.normalize(tensor: Tensor, shape: list[int], time: float = 0.0, speed: float = 1.0) Tensor[source]¶
- Rendering...
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.ridge(tensor: Tensor, shape: list[int], time: float = 0.0, speed: float = 1.0) Tensor[source]¶
- Rendering...
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.sine(tensor: Tensor, shape: list[int], amount: float = 1.0, time: float = 0.0, speed: float = 1.0, rgb: bool = False) Tensor[source]¶
- Rendering...
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
amount – Amount
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
rgb – Treat as RGB (vs grayscale)
- Returns:
Modified tensor
- noisemaker.effects.value_refract(tensor: Tensor, shape: list[int], freq: int | list[int] = 4, distrib: int | PointDistribution | ValueDistribution = ValueDistribution.center_circle, displacement: float = 0.125, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
- Rendering...
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
freq – Noise frequency
distrib – Distrib
displacement – Displacement amount
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
- noisemaker.effects.blur(tensor: Tensor, shape: list[int], amount: float = 10.0, spline_order: int | InterpolationType = InterpolationType.bicubic, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
- Rendering...
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
amount – Amount
spline_order – Interpolation type for resampling
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Modified tensor
noisemaker.value¶
Procedural helpers for constructing and manipulating value-noise tensors.
Low-level value noise functions
- noisemaker.value.set_seed(seed: int | None) None[source]¶
Set the random seed for noise generation.
- Parameters:
seed – Random seed value, or None to skip seeding
- Returns:
Processed tensor
- noisemaker.value.value_noise(count: int, freq: int = 8) Tensor[source]¶
Generate 1D value noise samples.
- Parameters:
count – Number of samples to generate
freq – Frequency for noise generation
- Returns:
Processed tensor
- noisemaker.value.values(freq: int | list[int], shape: list[int], distrib: ValueDistribution | None = ValueDistribution.simplex, corners: bool = False, mask: ValueMask | None = None, mask_inverse: bool = False, mask_static: bool = False, spline_order: int | InterpolationType = InterpolationType.bicubic, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
Generate a tensor of noise values with specified distribution.
- Parameters:
freq – Frequency for noise generation
shape – Shape of the tensor [height, width, channels]
distrib – Value distribution method
corners – Include corner values
mask – Value mask to apply
mask_inverse – Invert the mask
mask_static – Use static mask values
spline_order – Interpolation type for resampling
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Processed tensor
- noisemaker.value.distance(a: Tensor, b: Tensor, metric: int | DistanceMetric = DistanceMetric.euclidean, sdf_sides: int = 5) Tensor[source]¶
Compute the distance from a to b, using the specified metric.
- Parameters:
a – First value for blending/distance
b – Second value for blending/distance
metric – Distance metric to use
sdf_sides – SDF polygon sides for distance metric
- Returns:
Processed tensor
- noisemaker.value.voronoi(tensor: Tensor, shape: list[int], diagram_type: VoronoiDiagramType = VoronoiDiagramType.range, nth: int = 0, dist_metric: int | DistanceMetric = DistanceMetric.euclidean, sdf_sides: int = 3, alpha: float = 1.0, with_refract: float = 0.0, inverse: bool = False, xy: TypeAliasForwardRef('Tensor') | None = None, ridges_hint: bool = False, refract_y_from_offset: bool = True, time: float = 0.0, speed: float = 1.0, point_freq: int = 3, point_generations: int = 1, point_distrib: PointDistribution = PointDistribution.random, point_drift: float = 0.0, point_corners: bool = False, downsample: bool = True) Tensor[source]¶
Create a voronoi diagram, blending with input image Tensor color values.
Rendering...- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
diagram_type – Type of Voronoi diagram
nth – Use nth closest point
dist_metric – Distance metric to use
sdf_sides – SDF polygon sides for distance metric
alpha – Blending alpha value (0.0-1.0)
with_refract – Apply refraction amount
inverse – Invert the effect
xy – Optional XY coordinates for point cloud
ridges_hint – Apply ridge transformation hint
refract_y_from_offset – Use Y offset for refraction
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
point_freq – Point frequency for Voronoi
point_generations – Point generation count
point_distrib – Point distribution method
point_drift – Point drift amount
point_corners – Include corner points
downsample – Downsample the result
- Returns:
Processed tensor
- noisemaker.value.periodic_value(time: float, value: float) Tensor[source]¶
Coerce the received value to animate smoothly between time values 0 and 1, by applying a sine function and scaling the result.
- Parameters:
time – Time value for animation (0.0-1.0)
value – Input value
- Returns:
Processed tensor
- noisemaker.value.normalize(tensor: Tensor, signed_range: bool = False) Tensor[source]¶
Squeeze the given Tensor into a range between 0 and 1.
- Parameters:
tensor – Input tensor to process
signed_range – Use signed range (-1 to 1)
- Returns:
Normalized tensor
- noisemaker.value.resample(tensor: Tensor, shape: list[int], spline_order: int | InterpolationType = 3) Tensor[source]¶
Resize an image tensor to the specified shape.
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
spline_order – Interpolation type for resampling
- Returns:
Processed tensor
- noisemaker.value.proportional_downsample(tensor: Tensor, shape: list[int], new_shape: list[int]) Tensor[source]¶
Given a new shape which is evenly divisible by the old shape, shrink the image by averaging pixel values.
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
new_shape – New shape for resampling
- Returns:
Processed tensor
- noisemaker.value.row_index(shape: list[int]) Tensor[source]¶
Generate an X index for the given tensor. .. code-block:: python [ [ 0, 1, 2, … width-1 ], [ 0, 1, 2, … width-1 ], … (x height) ] .. image:: images/row_index.jpg :width: 1024 :height: 256 :alt: Noisemaker example output (CC0)
- Parameters:
shape – Shape of the tensor [height, width, channels]
- Returns:
Index tensor
- noisemaker.value.column_index(shape: list[int]) Tensor[source]¶
Generate a Y index for the given tensor. .. code-block:: python [ [ 0, 0, 0, … ], [ 1, 1, 1, … ], [ n, n, n, … ], … [ height-1, height-1, height-1, … ] ] .. image:: images/column_index.jpg :width: 1024 :height: 256 :alt: Noisemaker example output (CC0)
- Parameters:
shape – Shape of the tensor [height, width, channels]
- Returns:
Index tensor
- noisemaker.value.offset(tensor: Tensor, shape: list[int], x: int | float = 0, y: int | float = 0) Tensor[source]¶
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
x – X offset amount
y – Y offset amount
- Returns:
Processed tensor
- noisemaker.value.blend(a: Tensor, b: Tensor, g: Tensor) Tensor[source]¶
Blend a and b values with linear interpolation.
- Parameters:
a – First value for blending/distance
b – Second value for blending/distance
g – Interpolation factor (0.0-1.0)
- Returns:
Blended tensor
- noisemaker.value.blend_cosine(a: Tensor, b: Tensor, g: Tensor) Tensor[source]¶
Blend a and b values with cosine interpolation.
- Parameters:
a – First value for blending/distance
b – Second value for blending/distance
g – Interpolation factor (0.0-1.0)
- Returns:
Blended tensor
- noisemaker.value.blend_cubic(a: Tensor, b: Tensor, c: Tensor, d: Tensor, g: Tensor) Tensor[source]¶
Blend b and c values with bi-cubic interpolation.
- Parameters:
a – First value for blending/distance
b – Second value for blending/distance
c – Third value for blending
d – Fourth value for blending
g – Interpolation factor (0.0-1.0)
- Returns:
Blended tensor
- noisemaker.value.smoothstep(tensor: Tensor, shape: list[int], a: Tensor = 0.0, b: Tensor = 1.0, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
- Rendering...
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
a – First value for blending/distance
b – Second value for blending/distance
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Processed tensor
- noisemaker.value.freq_for_shape(freq: int | list[int], shape: list[int]) Tensor[source]¶
Given a base frequency as int, generate noise frequencies for each spatial dimension.
- Parameters:
freq – Frequency for noise generation
shape – Shape of the tensor [height, width, channels]
- Returns:
Processed tensor
- noisemaker.value.ridge(tensor: Tensor) Tensor[source]¶
Create a “ridge” at midpoint values. 1 - abs(n * 2 - 1) .. image:: images/crease.jpg :width: 1024 :height: 256 :alt: Noisemaker example output (CC0)
- Parameters:
tensor – Input tensor to process
- Returns:
Processed tensor
- noisemaker.value.simple_multires(freq: int | list[int], shape: list[int], octaves: int = 1, spline_order: int | InterpolationType = InterpolationType.bicubic, distrib: ValueDistribution = ValueDistribution.simplex, corners: bool = False, ridges: bool = False, mask: ValueMask | None = None, mask_inverse: bool = False, mask_static: bool = False, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
Generate multi-octave value noise. Unlike generators.multires, this function is single-channel and does not apply effects.
- Parameters:
freq – Frequency for noise generation
shape – Shape of the tensor [height, width, channels]
octaves – Number of octave layers
spline_order – Interpolation type for resampling
distrib – Value distribution method
corners – Include corner values
ridges – Apply ridge transformation
mask – Value mask to apply
mask_inverse – Invert the mask
mask_static – Use static mask values
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Processed tensor
- noisemaker.value.value_shape(shape: list[int]) Tensor[source]¶
- Parameters:
shape – Shape of the tensor [height, width, channels]
- Returns:
Processed tensor
- noisemaker.value.normalized_sine(value: float) Tensor[source]¶
- Parameters:
value – Input value
- Returns:
Normalized tensor
- noisemaker.value.convolve(tensor: Tensor, shape: list[int], kernel: ValueMask = ValueMask.conv2d_blur, with_normalize: bool = True, alpha: float = 1.0, time: float = 0.0, speed: float = 1.0) Tensor[source]¶
Apply a convolution kernel to an image tensor. .. code-block:: python image = convolve(image, shape, ValueMask.conv2d_shadow)
Rendering...- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
kernel – Convolution kernel mask
with_normalize – Normalize the output
alpha – Blending alpha value (0.0-1.0)
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Processed tensor
- noisemaker.value.refract(tensor: Tensor, shape: list[int], displacement: float = 0.5, reference_x: TypeAliasForwardRef('Tensor') | None = None, reference_y: TypeAliasForwardRef('Tensor') | None = None, warp_freq: int | list[int] | None = None, spline_order: int | InterpolationType = InterpolationType.bicubic, from_derivative: bool = False, signed_range: bool = True, time: float = 0.0, speed: float = 1.0, y_from_offset: bool = False) Tensor[source]¶
Apply displacement from pixel values.
Rendering...- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
displacement – Displacement
reference_x – Reference x
reference_y – Reference y
warp_freq – Warp freq
spline_order – Interpolation type for resampling
from_derivative – From derivative
signed_range – Use signed range (-1 to 1)
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
y_from_offset – Y from offset
- Returns:
Processed tensor
- noisemaker.value.value_map(tensor: Tensor, shape: list[int], keepdims: bool = False, signed_range: bool = False, with_normalize: bool = True) Tensor[source]¶
Create a grayscale value map from the given image Tensor, based on apparent luminance. Return value ranges between 0 and 1.
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
keepdims – Keepdims
signed_range – Use signed range (-1 to 1)
with_normalize – Normalize the output
- Returns:
Processed tensor
- noisemaker.value.singularity(tensor: Tensor, shape: list[int], diagram_type: VoronoiDiagramType = VoronoiDiagramType.range, **kwargs: Any) Tensor[source]¶
Return the range diagram for a single voronoi point, approximately centered.
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
diagram_type – Type of Voronoi diagram
**kwargs – Additional keyword arguments for voronoi
- Returns:
Processed tensor
- noisemaker.value.pin_corners(tensor: Tensor, shape: list[int], freq: int | list[int], corners: bool) Tensor[source]¶
Pin values to image corners, or align with image center, as per the given “corners” arg.
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
freq – Frequency for noise generation
corners – Include corner values
- Returns:
Processed tensor
- noisemaker.value.coerce_enum(value: Any, cls: type) Any[source]¶
Attempt to coerce a given string or int value into an Enum instance.
- Parameters:
value – Input value
cls – Enum class to coerce to
- Returns:
Processed tensor
- noisemaker.value.clamp01(tensor: Tensor) Tensor[source]¶
- Parameters:
tensor – Input tensor to process
- Returns:
Processed tensor
- noisemaker.value.fxaa(tensor: Tensor, shape: list[int], time: float = 0.0, speed: float = 1.0) Tensor[source]¶
- Rendering...
- Parameters:
tensor – Input tensor to process
shape – Shape of the tensor [height, width, channels]
time – Time value for animation (0.0-1.0)
speed – Animation speed multiplier
- Returns:
Processed tensor
noisemaker.composer¶
Preset-based noise composition system.
Extremely high-level interface for composable noise presets. See detailed docs.
- class noisemaker.composer.Preset(preset_name: str, presets: dict[str, Any], settings: dict[str, Any] | None = None)[source]¶
Bases:
objectA composable noise preset with layered effects and settings.
This class represents a preset configuration that can generate procedural noise with various effects applied in stages (per-octave, post-reduce, and final).
- __init__(preset_name: str, presets: dict[str, Any], settings: dict[str, Any] | None = None)[source]¶
Initialize a Preset from the presets dictionary.
- Parameters:
preset_name – Name of the preset to load
presets – Dictionary of all available presets
settings – Optional settings overrides
- render(seed: int, tensor: TypeAliasForwardRef('Tensor') | None = None, shape: list[int] = [1024, 1024, 3], time: float = 0.0, speed: float = 1.0, filename: str = 'art.png', with_alpha: bool = False, with_supersample: bool = False, with_fxaa: bool = False, with_upscale: bool = False, debug: bool = False) TypeAliasForwardRef('Tensor') | dict[str, Any][source]¶
Render the preset to an image file or return execution graph if debug.
- Parameters:
seed – Random seed for generation
tensor – Optional input tensor to process
shape – Output shape [height, width, channels]
time – Time parameter for animation
speed – Speed multiplier for animation
filename – Output filename
with_alpha – Include alpha channel
with_supersample – Use 2x supersampling
with_fxaa – Apply FXAA antialiasing
with_upscale – Use AI upscaling
debug – Return execution graph instead of rendering
- Returns:
Rendered tensor, or execution graph dict if debug=True
- noisemaker.composer.Effect(effect_name: str, **kwargs: Any) Callable[source]¶
Create a partial effect function with preset parameters.
The returned function can be invoked with runtime parameters: tensor, shape, time, and speed.
- Parameters:
effect_name – Name of the registered effect to wrap.
**kwargs – Parameter overrides to bind to the effect function.
- Returns:
Partial function with preset parameters bound.
- Raises:
ValueError – If effect_name is not registered or kwargs contains invalid parameters.
- noisemaker.composer.random_member(*collections: Any) Any[source]¶
Select a random member from one or more collections, ensuring deterministic ordering.
Accepts enums, enum lists, or regular collections. Multiple collections are merged before selection. Order is deterministic to ensure consistent RNG behavior.
RNG: Single call to
rng.random_int()to choose the index.- Parameters:
*collections – One or more iterables (enums, lists, sets, etc.) to select from.
- Returns:
A randomly selected member from the merged collections.
- Raises:
ValueError – If any argument is not iterable.
- noisemaker.composer.coin_flip() bool[source]¶
Return a random boolean (True/False with equal probability).
RNG: Single call to
rng.random_int()with range [0, 1].- Returns:
Randomly selected True or False.
- noisemaker.composer.enum_range(a: Enum, b: Enum) list[Enum][source]¶
Return a list of enum members within the specified inclusive numeric value range.
- Parameters:
a – Starting enum member (inclusive).
b – Ending enum member (inclusive).
- Returns:
List of all enum members from a.value to b.value (inclusive).
- noisemaker.composer.reload_presets(presets: Callable[[], dict[str, Any]]) None[source]¶
Re-evaluate all presets and categorize them as generators or effects.
Clears existing preset caches and reloads from the provided factory function. This should be called after changing the random seed to get fresh evaluations.
- Parameters:
presets – Factory function that returns a dictionary of preset definitions.
- Raises:
ValueError – If any preset fails to initialize or validate.
- noisemaker.composer.stash(key: str, value: Any | None = None) Any[source]¶
Store and retrieve values for cross-reference within preset lambda functions.
Useful for holding intermediate values that need to be shared across multiple effect definitions within the same preset.
- Parameters:
key – Identifier for the stashed value.
value – Value to store (if provided).
- Returns:
The currently stored value for the given key.
- exception noisemaker.composer.UnusedKeys[source]¶
Bases:
ExceptionException raised when a preset has keys that aren’t being used.
noisemaker.constants¶
Enumeration constants for noise generation.
Constants used in Noisemaker
- class noisemaker.constants.DistanceMetricMixin[source]¶
Bases:
objectSpecify the distance metric used in various operations, such as Voronoi cells, derivatives, and sobel operators.
- classmethod all() list[DistanceMetric][source]¶
Get all distance metrics except none.
- Returns:
List of all non-none distance metrics
- classmethod absolute_members() list[DistanceMetric][source]¶
Get all distance metrics that require absolute inputs.
- Returns:
List of absolute distance metrics (euclidean, manhattan, chebyshev, octagram)
- classmethod is_absolute(member: DistanceMetric) bool[source]¶
Check if a distance metric requires absolute inputs.
- Parameters:
member – Distance metric to check
- Returns:
True if metric requires absolute inputs
- classmethod signed_members() list[DistanceMetric][source]¶
Get all distance metrics that require signed inputs.
- Returns:
List of signed distance metrics (triangular, hexagram, sdf)
- classmethod is_signed(member: DistanceMetric) bool[source]¶
Check if a distance metric requires signed inputs.
- Parameters:
member – Distance metric to check
- Returns:
True if metric requires signed inputs
- class noisemaker.constants.DistanceMetric(*values)[source]¶
Bases:
DistanceMetricMixin,Enum- chebyshev = 3¶
- euclidean = 1¶
- hexagram = 102¶
- manhattan = 2¶
- none = 0¶
- octagram = 4¶
- sdf = 201¶
- triangular = 101¶
- class noisemaker.constants.InterpolationTypeMixin[source]¶
Bases:
objectSpecify the spline point count for interpolation operations.
- class noisemaker.constants.InterpolationType(*values)[source]¶
Bases:
InterpolationTypeMixin,Enum- bicubic = 3¶
- constant = 0¶
- cosine = 2¶
- linear = 1¶
- class noisemaker.constants.PointDistributionMixin[source]¶
Bases:
objectPoint cloud distribution, used by Voronoi and DLA
- classmethod grid_members() list[PointDistribution][source]¶
Get all grid-based point distributions.
- Returns:
List of grid-based point distribution types
- classmethod circular_members() list[PointDistribution][source]¶
Get all circular point distributions.
- Returns:
List of circular point distribution types
- classmethod is_grid(member: PointDistribution) bool[source]¶
Check if a point distribution is grid-based.
- Parameters:
member – Point distribution type to check
- Returns:
True if the distribution is grid-based
- classmethod is_circular(member: PointDistribution) bool[source]¶
Check if a point distribution is circular.
- Parameters:
member – Point distribution type to check
- Returns:
True if the distribution is circular
- class noisemaker.constants.PointDistribution(*values)[source]¶
Bases:
PointDistributionMixin,Enum- chess = 1000003¶
- circular = 1000100¶
- concentric = 1000101¶
- h_hex = 1000010¶
- random = 1000000¶
- rotating = 1000102¶
- spiral = 1000050¶
- square = 1000001¶
- v_hex = 1000011¶
- waffle = 1000002¶
- class noisemaker.constants.ValueDistributionMixin[source]¶
Bases:
objectSpecify the value distribution function for basic noise.
image = basic(freq, [height, width, channels], distrib=ValueDistribution.simplex)
- classmethod is_noise(member) bool[source]¶
Check if a value distribution is noise-based.
- Parameters:
member – Value distribution type to check
- Returns:
True if the distribution is noise-based
- class noisemaker.constants.ValueDistribution(*values)[source]¶
Bases:
ValueDistributionMixin,Enum- center_circle = 20¶
- center_decagon = 30¶
- center_diamond = 21¶
- center_dodecagon = 32¶
- center_hendecagon = 31¶
- center_heptagon = 27¶
- center_hexagon = 26¶
- center_nonagon = 29¶
- center_octagon = 28¶
- center_pentagon = 25¶
- center_square = 24¶
- center_triangle = 23¶
- column_index = 10¶
- exp = 2¶
- mids = 6¶
- ones = 5¶
- row_index = 11¶
- simplex = 1¶
- zeros = 7¶
- class noisemaker.constants.ValueMaskMixin[source]¶
Bases:
object- classmethod conv2d_members() list[ValueMask][source]¶
Get all conv2d-based value masks.
- Returns:
List of conv2d value mask types
- classmethod is_conv2d(member: ValueMask) bool[source]¶
Check if a value mask is conv2d-based.
- Parameters:
member – Value mask type to check
- Returns:
True if the mask is conv2d-based
- classmethod grid_members() list[ValueMask][source]¶
Get all grid-based value masks.
- Returns:
List of grid-based value mask types
- classmethod is_grid(member: ValueMask) bool[source]¶
Check if a value mask is grid-based.
- Parameters:
member – Value mask type to check
- Returns:
True if the mask is grid-based
- classmethod rgb_members() list[ValueMask][source]¶
Get all RGB value masks.
- Returns:
List of RGB value mask types
- classmethod is_rgb(member: ValueMask) bool[source]¶
Check if a value mask is RGB-based.
- Parameters:
member – Value mask type to check
- Returns:
True if the mask is RGB-based
- classmethod nonprocedural_members() list[ValueMask][source]¶
Get all non-procedural value masks.
- Returns:
List of non-procedural value mask types
- classmethod procedural_members() list[ValueMask][source]¶
Get all procedural value masks.
- Returns:
List of procedural value mask types
- classmethod is_procedural(member: ValueMask) bool[source]¶
Check if a value mask is procedural.
- Parameters:
member – Value mask type to check
- Returns:
True if the mask is procedural
- class noisemaker.constants.ValueMask(*values)[source]¶
Bases:
ValueMaskMixin,Enum- ace = 911¶
- alphanum_0 = 20¶
- alphanum_1 = 21¶
- alphanum_2 = 22¶
- alphanum_3 = 23¶
- alphanum_4 = 24¶
- alphanum_5 = 25¶
- alphanum_6 = 26¶
- alphanum_7 = 27¶
- alphanum_8 = 28¶
- alphanum_9 = 29¶
- alphanum_a = 30¶
- alphanum_b = 31¶
- alphanum_binary = 1013¶
- alphanum_c = 32¶
- alphanum_d = 33¶
- alphanum_e = 34¶
- alphanum_f = 35¶
- alphanum_hex = 1015¶
- alphanum_numeric = 1014¶
- arecibo = 1034¶
- arecibo_bignum = 1031¶
- arecibo_dna = 1033¶
- arecibo_nucleotide = 1032¶
- arecibo_num = 1030¶
- bank_ocr = 1070¶
- bank_ocr_0 = 250¶
- bank_ocr_1 = 251¶
- bank_ocr_2 = 252¶
- bank_ocr_3 = 253¶
- bank_ocr_4 = 254¶
- bank_ocr_5 = 255¶
- bank_ocr_6 = 256¶
- bank_ocr_7 = 257¶
- bank_ocr_8 = 258¶
- bank_ocr_9 = 259¶
- bar_code = 1060¶
- bar_code_short = 1061¶
- chess = 3¶
- conv2d_blur = 800¶
- conv2d_box_blur = 810¶
- conv2d_deriv_x = 801¶
- conv2d_deriv_y = 802¶
- conv2d_edges = 803¶
- conv2d_emboss = 804¶
- conv2d_invert = 805¶
- conv2d_rand = 806¶
- conv2d_sharpen = 807¶
- conv2d_sobel_x = 808¶
- conv2d_sobel_y = 809¶
- dropout = 1100¶
- emoji = 1051¶
- emoji_00 = 200¶
- emoji_01 = 201¶
- emoji_02 = 202¶
- emoji_03 = 203¶
- emoji_04 = 204¶
- emoji_05 = 205¶
- emoji_06 = 206¶
- emoji_07 = 207¶
- emoji_08 = 208¶
- emoji_09 = 209¶
- emoji_10 = 210¶
- emoji_11 = 211¶
- emoji_12 = 212¶
- emoji_13 = 213¶
- emoji_14 = 214¶
- emoji_15 = 215¶
- emoji_16 = 216¶
- emoji_17 = 217¶
- emoji_18 = 218¶
- emoji_19 = 219¶
- emoji_20 = 220¶
- emoji_21 = 221¶
- emoji_22 = 222¶
- emoji_23 = 223¶
- emoji_24 = 224¶
- emoji_25 = 225¶
- emoji_26 = 226¶
- emoji_27 = 227¶
- fake_qr = 1080¶
- fat_lcd = 1024¶
- fat_lcd_0 = 70¶
- fat_lcd_1 = 71¶
- fat_lcd_2 = 72¶
- fat_lcd_3 = 73¶
- fat_lcd_4 = 74¶
- fat_lcd_5 = 75¶
- fat_lcd_6 = 76¶
- fat_lcd_7 = 77¶
- fat_lcd_8 = 78¶
- fat_lcd_9 = 79¶
- fat_lcd_a = 80¶
- fat_lcd_b = 81¶
- fat_lcd_binary = 1025¶
- fat_lcd_c = 82¶
- fat_lcd_d = 83¶
- fat_lcd_e = 84¶
- fat_lcd_f = 85¶
- fat_lcd_g = 86¶
- fat_lcd_h = 87¶
- fat_lcd_hex = 1027¶
- fat_lcd_i = 88¶
- fat_lcd_j = 89¶
- fat_lcd_k = 90¶
- fat_lcd_l = 91¶
- fat_lcd_m = 92¶
- fat_lcd_n = 93¶
- fat_lcd_numeric = 1026¶
- fat_lcd_o = 94¶
- fat_lcd_p = 95¶
- fat_lcd_q = 96¶
- fat_lcd_r = 97¶
- fat_lcd_s = 98¶
- fat_lcd_t = 99¶
- fat_lcd_u = 100¶
- fat_lcd_v = 101¶
- fat_lcd_w = 102¶
- fat_lcd_x = 103¶
- fat_lcd_y = 104¶
- fat_lcd_z = 105¶
- grid = 4¶
- h_bar = 5¶
- h_hex = 10¶
- h_tri = 12¶
- halftone = 1021¶
- halftone_0 = 50¶
- halftone_1 = 51¶
- halftone_2 = 52¶
- halftone_3 = 53¶
- halftone_4 = 54¶
- halftone_5 = 55¶
- halftone_6 = 56¶
- halftone_7 = 57¶
- halftone_8 = 58¶
- halftone_9 = 59¶
- iching = 1009¶
- ideogram = 1008¶
- invaders = 1003¶
- invaders_large = 1004¶
- invaders_square = 1005¶
- lcd = 1022¶
- lcd_0 = 60¶
- lcd_1 = 61¶
- lcd_2 = 62¶
- lcd_3 = 63¶
- lcd_4 = 64¶
- lcd_5 = 65¶
- lcd_6 = 66¶
- lcd_7 = 67¶
- lcd_8 = 68¶
- lcd_9 = 69¶
- lcd_binary = 1023¶
- letters = 1007¶
- matrix = 1006¶
- mcpaint = 1050¶
- mcpaint_00 = 130¶
- mcpaint_01 = 131¶
- mcpaint_02 = 132¶
- mcpaint_03 = 133¶
- mcpaint_04 = 134¶
- mcpaint_05 = 135¶
- mcpaint_06 = 136¶
- mcpaint_07 = 137¶
- mcpaint_08 = 138¶
- mcpaint_09 = 139¶
- mcpaint_10 = 140¶
- mcpaint_11 = 141¶
- mcpaint_12 = 142¶
- mcpaint_13 = 143¶
- mcpaint_14 = 144¶
- mcpaint_15 = 145¶
- mcpaint_16 = 146¶
- mcpaint_17 = 147¶
- mcpaint_18 = 148¶
- mcpaint_19 = 149¶
- mcpaint_20 = 150¶
- mcpaint_21 = 151¶
- mcpaint_22 = 152¶
- mcpaint_23 = 153¶
- mcpaint_24 = 154¶
- mcpaint_25 = 155¶
- mcpaint_26 = 156¶
- mcpaint_27 = 157¶
- mcpaint_28 = 158¶
- mcpaint_29 = 159¶
- mcpaint_30 = 160¶
- mcpaint_31 = 161¶
- mcpaint_32 = 162¶
- mcpaint_33 = 163¶
- mcpaint_34 = 164¶
- mcpaint_35 = 165¶
- mcpaint_36 = 166¶
- mcpaint_37 = 167¶
- mcpaint_38 = 168¶
- mcpaint_39 = 169¶
- mcpaint_40 = 170¶
- nb = 912¶
- rainbow = 910¶
- rbggbr = 901¶
- rgb = 900¶
- rgbgr = 903¶
- rggb = 902¶
- roygbiv = 904¶
- script = 1010¶
- sparse = 1000¶
- sparser = 1001¶
- sparsest = 1002¶
- square = 1¶
- trans = 913¶
- tromino = 1012¶
- tromino_i = 40¶
- tromino_l = 41¶
- tromino_o = 42¶
- tromino_s = 43¶
- truchet_curves = 1041¶
- truchet_curves_00 = 112¶
- truchet_curves_01 = 113¶
- truchet_lines = 1040¶
- truchet_lines_00 = 110¶
- truchet_lines_01 = 111¶
- truchet_tile = 1042¶
- truchet_tile_00 = 120¶
- truchet_tile_01 = 121¶
- truchet_tile_02 = 122¶
- truchet_tile_03 = 123¶
- truetype = 1020¶
- v_bar = 6¶
- v_hex = 11¶
- v_tri = 13¶
- waffle = 2¶
- white_bear = 1011¶
- class noisemaker.constants.VoronoiDiagramTypeMixin[source]¶
Bases:
objectSpecify the artistic rendering function used for Voronoi diagrams.
- classmethod flow_members() list[VoronoiDiagramType][source]¶
Get all flow-based Voronoi diagram types.
- Returns:
List of flow Voronoi diagram types
- classmethod is_flow_member(member: VoronoiDiagramType) bool[source]¶
Check if a Voronoi diagram type is flow-based.
- Parameters:
member – Voronoi diagram type to check
- Returns:
True if the diagram type is flow-based
- class noisemaker.constants.VoronoiDiagramType(*values)[source]¶
Bases:
VoronoiDiagramTypeMixin,Enum- color_flow = 42¶
- color_range = 12¶
- color_regions = 22¶
- flow = 41¶
- none = 0¶
- range = 11¶
- range_regions = 31¶
- regions = 21¶
- class noisemaker.constants.WormBehaviorMixin[source]¶
Bases:
objectSpecify the type of heading bias for worms to follow.
image = worms(image, behavior=WormBehavior.unruly)
- classmethod all() list[WormBehavior][source]¶
Get all worm behaviors except none.
- Returns:
List of all non-none worm behaviors
- class noisemaker.constants.WormBehavior(*values)[source]¶
Bases:
WormBehaviorMixin,Enum- chaotic = 4¶
- crosshatch = 2¶
- meandering = 10¶
- none = 0¶
- obedient = 1¶
- random = 5¶
- unruly = 3¶
- class noisemaker.constants.OctaveBlendingMixin[source]¶
Bases:
objectSpecify the mode for flattening octaves.
- class noisemaker.constants.OctaveBlending(*values)[source]¶
Bases:
OctaveBlendingMixin,Enum- alpha = 20¶
- falloff = 0¶
- reduce_max = 10¶
- class noisemaker.constants.ColorSpaceMixin[source]¶
Bases:
object- classmethod is_color(m: ColorSpace) bool[source]¶
Check if a color space has color channels.
- Parameters:
m – Color space to check
- Returns:
True if the color space has color channels (not grayscale)
- classmethod color_members() list[ColorSpace][source]¶
Get all color spaces with color channels.
- Returns:
List of color space types with color channels
noisemaker.dsl¶
DSL parser and evaluator for Composer presets.
- noisemaker.dsl.defaultContext¶
Default evaluation context containing enums, operations, surfaces, and enum methods.
noisemaker.effects_registry¶
Registry and decorators for Noisemaker composer effects.
Effect decorator for Noisemaker Composer Presets
- noisemaker.effects_registry.effect(*args: str) Callable[source]¶
Function decorator for declaring composable effects.
Registers effect functions with their parameter defaults for use in Composer presets. Validates that effects accept required “time” and “speed” keyword arguments.
- Parameters:
*args – Optional effect name. If not provided, uses function name.
- Returns:
Decorator function that registers the effect and returns the original function
- Raises:
ValueError – If function doesn’t accept required “time” or “speed” parameters, or if keyword parameter counts don’t match defaults
noisemaker.glyphs¶
Font and glyph rendering utilities.
- noisemaker.glyphs.load_fonts() list[str][source]¶
Find all TrueType fonts in the ~/.noisemaker/fonts directory.
- Returns:
List of absolute paths to .ttf font files, or empty list if fonts directory doesn’t exist.
- noisemaker.glyphs.load_glyphs(shape: list[int]) list[list[list[list[float]]]][source]¶
Generate a list of ASCII character glyphs sorted from darkest to brightest.
Renders printable ASCII characters (32-126) using a randomly selected font, then sorts them by brightness for use in value-based text rendering.
RNG: One call to
random.randint()to select font.- Parameters:
shape – Glyph dimensions as [height, width].
- Returns:
List of glyphs, where each glyph is [y][x][channel] with normalized [0.0, 1.0] values. Sorted from darkest (space) to brightest (dense characters).
noisemaker.masks¶
Mask generation and application functions.
The Masks dictionary contains pre-defined mask patterns for all ValueMask enum members.
See noisemaker.constants.ValueMask for available mask types.
Value masks for Noisemaker. Used when generating value noise or glyph maps.
- noisemaker.masks.mask(*args: Any) Callable[source]¶
Function decorator for procedural masks.
- Parameters:
*args – Optional mask shape specification
- Returns:
Decorator function for registering mask functions
- noisemaker.masks.mask_shape(mask: ValueMask) list[int][source]¶
Return the shape for the received ValueMask.
- Parameters:
mask – ValueMask to get shape for
- Returns:
Shape as [height, width, channels]
- noisemaker.masks.get_atlas(mask: ValueMask) Any[source]¶
Get the glyph atlas for a procedural mask.
- Parameters:
mask – ValueMask to get atlas for
- Returns:
Atlas array or None if not applicable
- noisemaker.masks.mask_values(mask: ValueMask, glyph_shape: list[int] | None = None, uv_noise: <MagicMock name = 'mock.__or__()' id='140326739791264'> = None, atlas: <MagicMock name = 'mock.__or__()' id='140326742545984'> = None, inverse: bool = False, time: float = 0.0, speed: float = 1.0) tuple[list[list[Any]], float][source]¶
Return pixel values for the received ValueMask.
- Parameters:
mask – ValueMask to render
glyph_shape – Shape of the mask being rendered [height, width, channels]
uv_noise – Per-pixel noise values, shaped like glyph_shape
atlas – Pre-rendered atlas of images (e.g., TrueType letters)
inverse – Return the inverse of the mask
time – Time parameter for animation
speed – Animation speed multiplier
- Returns:
Mask value array
- noisemaker.masks.uv_random(uv_noise: <MagicMock id = '140326740718656'>, uv_x: int, uv_y: int) float[source]¶
- noisemaker.masks.square_masks() list[ValueMask][source]¶
Return a list of square ValueMasks.
- Returns:
List of ValueMasks with square dimensions
- noisemaker.masks.dropout(uv_noise: <MagicMock id = '140326741205376'>, uv_x: int, uv_y: int, **kwargs: Any) Any[source]¶
- noisemaker.masks.sparse(uv_noise: <MagicMock id = '140326739498560'>, uv_x: int, uv_y: int, **kwargs: Any) Any[source]¶
- noisemaker.masks.sparser(uv_noise: <MagicMock id = '140326739500480'>, uv_x: int, uv_y: int, **kwargs: Any) Any[source]¶
- noisemaker.masks.sparsest(uv_noise: <MagicMock id = '140326739502064'>, uv_x: int, uv_y: int, **kwargs: Any) Any[source]¶
- noisemaker.masks.matrix(x: int, y: int, row: int, shape: list[int], uv_noise: <MagicMock id='140326739738064'>, uv_x: int, uv_y: int, **kwargs: ~typing.Any) Any[source]¶
- noisemaker.masks.letters(x: int, y: int, row: int, shape: list[int], uv_noise: <MagicMock id='140326739796496'>, uv_x: int, uv_y: int, **kwargs: ~typing.Any) Any[source]¶
- noisemaker.masks.iching(x: int, y: int, row: list[~typing.Any], shape: list[int], uv_noise: <MagicMock id='140326739791312'>, uv_x: int, uv_y: int, **kwargs: ~typing.Any) Any[source]¶
- noisemaker.masks.ideogram(x: int, y: int, row: int, shape: list[int], uv_noise: <MagicMock id='140326739771360'>, uv_x: int, uv_y: int, **kwargs: ~typing.Any) Any[source]¶
- noisemaker.masks.script(x: int, y: int, row: list[~typing.Any], shape: list[int], uv_noise: <MagicMock id='140326739360368'>, uv_y: int, uv_x: int, **kwargs: ~typing.Any) Any[source]¶
- noisemaker.masks.tromino(x: int, y: int, row: int, shape: list[int], uv_x: int, uv_y: int, uv_noise: <MagicMock id='140326739506240'>, uv_shape: list[int], atlas: <MagicMock id='140326739508448'>, **kwargs: ~typing.Any) Any[source]¶
- noisemaker.masks.truetype(x: int, y: int, row: int, shape: list[int], uv_x: int, uv_y: int, uv_noise: <MagicMock id='140326741236128'>, atlas: <MagicMock id='140326741232768'>, **kwargs: ~typing.Any) Any[source]¶
- noisemaker.masks.arecibo_num(x: int, y: int, row: int, shape: list[int], uv_noise: <MagicMock id='140326739827392'>, uv_x: int, uv_y: int, **kwargs: ~typing.Any) Any[source]¶
- noisemaker.masks.arecibo_nucleotide(x: int, y: int, row: int, shape: list[int], uv_noise: <MagicMock id='140326739836560'>, uv_x: int, uv_y: int, **kwargs: ~typing.Any) Any[source]¶
- noisemaker.masks.arecibo_dna(x: int, y: int, row: int, shape: list[int], uv_noise: <MagicMock id='140326741230656'>, uv_x: int, uv_y: int, **kwargs: ~typing.Any) Any[source]¶
- noisemaker.masks.arecibo(x: int, y: int, row: int, shape: list[int], uv_x: int, uv_y: int, uv_noise: <MagicMock id='140326741204848'>, glyph_shape: list[int], **kwargs: ~typing.Any) Any[source]¶
noisemaker.oklab¶
Oklab color space conversion utilities.
Oklab color space conversion.
noisemaker.palettes¶
Color palette definitions and utilities.
noisemaker.points¶
Point cloud generation utilities used for Voronoi and DLA effects.
Point cloud library for Noisemaker. Used for Voronoi and DLA functions.
- noisemaker.points.point_cloud(freq: int, distrib: PointDistribution | ValueMask = PointDistribution.random, shape: list[int] | None = None, corners: bool = False, generations: int = 1, drift: float = 0.0, time: float = 0.0, speed: float = 1.0) tuple[list[Any], list[Any]] | None[source]¶
Generate a point cloud for Voronoi diagrams or other point-based effects.
- Parameters:
freq – Point frequency/density
distrib – Point distribution method (PointDistribution or ValueMask)
shape – Optional shape [height, width, channels]
corners – If True, anchor points to corners instead of center
generations – Number of generations for iterative distributions
drift – Amount of random drift to apply to points
time – Time parameter for animation
speed – Animation speed multiplier
- Returns:
Tuple of (x_coords, y_coords) lists, or None if freq is 0
- noisemaker.points.cloud_points(count: int, seed: int | None = None) tuple[list[float], list[float]][source]¶
Convenience wrapper for random point clouds.
RNG:
count * count * 2calls torng.random()viarand(), ordered as x then y for each point.- Parameters:
count – Number of points per axis (total points = count * count).
seed – Optional random seed for reproducible output.
- Returns:
Tuple of (x_coords, y_coords) lists with normalized [0.0, 1.0] coordinates.
- noisemaker.points.rand(freq: int = 2, center_x: float = 0.5, center_y: float = 0.5, range_x: float = 0.5, range_y: float = 0.5, width: float = 1.0, height: float = 1.0, **kwargs: Any) tuple[list[float], list[float]][source]¶
Generate a random cloud of points within a specified region.
RNG:
freq * freq * 2calls torng.random(), ordered as x then y.- Parameters:
freq – Number of points per axis (total points = freq * freq).
center_x – Horizontal center of the distribution region [0.0, 1.0].
center_y – Vertical center of the distribution region [0.0, 1.0].
range_x – Horizontal radius from center [0.0, 1.0].
range_y – Vertical radius from center [0.0, 1.0].
width – Horizontal wrapping bounds.
height – Vertical wrapping bounds.
**kwargs – Unused; accepts additional parameters for compatibility.
- Returns:
Tuple of (x_coords, y_coords) lists with coordinates wrapped to [0.0, width) and [0.0, height).
- noisemaker.points.square_grid(freq: float = 1.0, distrib: PointDistribution | None = None, corners: bool = False, center_x: float = 0.0, center_y: float = 0.0, range_x: float = 1.0, range_y: float = 1.0, width: float = 1.0, height: float = 1.0, **kwargs: Any) tuple[list[float], list[float]][source]¶
Generate a square grid of points with optional distribution patterns.
Supports various grid patterns including waffle, chess, and hexagonal layouts.
- Parameters:
freq – Number of grid divisions per axis (total points = freq * freq).
distrib – Optional point distribution pattern (waffle, chess, h_hex, v_hex).
corners – If True, align grid to corners; otherwise center the grid.
center_x – Horizontal center offset [0.0, 1.0].
center_y – Vertical center offset [0.0, 1.0].
range_x – Horizontal scale factor.
range_y – Vertical scale factor.
width – Horizontal wrapping bounds.
height – Vertical wrapping bounds.
**kwargs – Unused; accepts additional parameters for compatibility.
- Returns:
Tuple of (x_coords, y_coords) lists with grid coordinates.
- noisemaker.points.spiral(freq: float = 1.0, center_x: float = 0.0, center_y: float = 0.0, range_x: float = 1.0, range_y: float = 1.0, width: float = 1.0, height: float = 1.0, time: float = 0.0, speed: float = 1.0, **kwargs: Any) tuple[list[float], list[float]][source]¶
Generate points along a spiral path with time-based rotation.
RNG: 1 call to
rng.random()for spiral kink factor.- Parameters:
freq – Number of points to generate.
center_x – Horizontal center of the spiral [0.0, 1.0].
center_y – Vertical center of the spiral [0.0, 1.0].
range_x – Horizontal radius of the spiral.
range_y – Vertical radius of the spiral.
width – Horizontal wrapping bounds.
height – Vertical wrapping bounds.
time – Animation time parameter for rotation.
speed – Animation speed multiplier.
**kwargs – Unused; accepts additional parameters for compatibility.
- Returns:
Tuple of (x_coords, y_coords) lists with spiral coordinates.
- noisemaker.points.circular(freq: float = 1.0, distrib: PointDistribution = PointDistribution.circular, center_x: float = 0.0, center_y: float = 0.0, range_x: float = 1.0, range_y: float = 1.0, width: float = 1.0, height: float = 1.0, generation: int = 1, time: float = 0.0, speed: float = 1.0, **kwargs: Any) tuple[list[float], list[float]][source]¶
Generate points in concentric circular rings.
Creates a center point surrounded by rings of evenly spaced points.
- Parameters:
freq – Number of rings and points per ring.
distrib – Point distribution method (circular or rotating).
center_x – Horizontal center of the circular pattern [0.0, 1.0].
center_y – Vertical center of the circular pattern [0.0, 1.0].
range_x – Horizontal radius scale factor.
range_y – Vertical radius scale factor.
width – Horizontal wrapping bounds.
height – Vertical wrapping bounds.
generation – Ring generation parameter for pattern variation.
time – Animation time parameter for rotation.
speed – Animation speed multiplier.
**kwargs – Unused; accepts additional parameters for compatibility.
- Returns:
Tuple of (x_coords, y_coords) lists with circular coordinates.
noisemaker.presets¶
Preset loading and management.
- noisemaker.presets.set_presets_path(path: str | Path | None) None[source]¶
Set a custom path for the presets DSL file.
When set, presets will be loaded from this path instead of the default share/dsl/presets.dsl location. Set to None to revert to the default.
- Parameters:
path – Path to a .dsl file containing preset definitions, or None to use default.
- noisemaker.presets.get_presets_path() Path[source]¶
Get the current presets DSL file path.
- Returns:
Path to the presets DSL file (either custom or default).
- noisemaker.presets.PRESETS() dict[str, Any][source]¶
Get a fresh copy of all presets with synchronized RNG state.
Returns a deep copy to prevent mutations from affecting the cached version. Includes mandatory RNG calls to maintain Python/JS parity.
- Returns:
Dictionary of all available preset definitions.
- noisemaker.presets.Preset(preset_name: str, *, settings: dict[str, Any] | None = None) Preset[source]¶
Create a Preset instance from the DSL preset collection.
Convenience factory function for creating preset objects with optional settings overrides.
- Parameters:
preset_name – Name of the preset to load from presets.dsl.
settings – Optional dictionary of setting overrides.
- Returns:
Configured Preset object ready for rendering.
- Raises:
ValueError – If preset_name is not found or preset definition is invalid.
noisemaker.rng¶
Deterministic RNG utilities that underpin preset and generator reproducibility.
Deterministic random number generation for Noisemaker.
- class noisemaker.rng.Random(seed: int)[source]¶
Bases:
objectDeterministic mulberry32 RNG with independent state.
- __init__(seed: int)[source]¶
Initialize a new random number generator.
- Parameters:
seed – Random seed value
- random_int(a: int, b: int) int[source]¶
Return a random integer N such that a <= N <= b.
- Parameters:
a – Minimum value (inclusive)
b – Maximum value (inclusive)
- Returns:
Random integer in range [a, b]
- choice(seq: Sequence[T]) T[source]¶
Return a random element from sequence.
- Parameters:
seq – Sequence to choose from
- Returns:
Random element from sequence
- Raises:
IndexError – If sequence is empty
- noisemaker.rng.set_seed(seed: int) None[source]¶
Set the global RNG seed.
- Parameters:
seed – Random seed value
- noisemaker.rng.get_call_count() int[source]¶
Return the number of RNG calls since last reset.
- Returns:
Number of RNG calls
- noisemaker.rng.random_int(a: int, b: int) int[source]¶
Return a random integer N such that a <= N <= b.
- Parameters:
a – Minimum value (inclusive)
b – Maximum value (inclusive)
- Returns:
Random integer in range [a, b]
- noisemaker.rng.randint(a: int, b: int) int¶
Return a random integer N such that a <= N <= b.
- Parameters:
a – Minimum value (inclusive)
b – Maximum value (inclusive)
- Returns:
Random integer in range [a, b]
- noisemaker.rng.choice(seq: Sequence[T]) T[source]¶
Return a random element from sequence.
- Parameters:
seq – Sequence to choose from
- Returns:
Random element from sequence
- Raises:
IndexError – If sequence is empty
- noisemaker.rng.uniform(shape, minval=0.0, maxval=1.0, dtype=<MagicMock id='140326759604464'>) Tensor[source]¶
Return a tensor of uniformly distributed random values from the custom RNG.
- Parameters:
shape – Shape specification for output tensor
minval – Minimum value (inclusive), default 0.0
maxval – Maximum value (exclusive), default 1.0
dtype – TensorFlow data type, default tf.float32
- Returns:
Tensor of uniformly distributed random values in [minval, maxval)
- noisemaker.rng.normal(shape, mean=0.0, stddev=1.0, dtype=<MagicMock id='140326793142176'>) Tensor[source]¶
Return a tensor of normally distributed random values from the custom RNG.
Uses Box-Muller transform to generate normally distributed values from uniform random values.
- Parameters:
shape – Shape specification for output tensor
mean – Mean of the normal distribution, default 0.0
stddev – Standard deviation of the normal distribution, default 1.0
dtype – TensorFlow data type, default tf.float32
- Returns:
Tensor of normally distributed random values with specified mean and stddev
noisemaker.simplex¶
Simplex noise implementation.
- noisemaker.simplex.set_seed(s: int) None[source]¶
Set the global simplex noise seed.
- Parameters:
s – Random seed value
- noisemaker.simplex.get_seed() int[source]¶
Get the current simplex noise seed, generating one if needed.
- Returns:
Current seed value
- class noisemaker.simplex.OpenSimplex(seed: int = 0)[source]¶
Bases:
object- __init__(seed: int = 0) None[source]¶
Initialize OpenSimplex noise generator.
- Parameters:
seed – Random seed value, default 0
- noisemaker.simplex.from_seed(seed: int) tuple[OpenSimplex, dict[str, list[int]]][source]¶
Create OpenSimplex generator from seed.
- Parameters:
seed – Random seed for generator initialization
- Returns:
Tuple of (initialized OpenSimplex generator, metadata dict)
- noisemaker.simplex.random(time: int | float = 0, seed: int | None = None, speed: int | float = 1) float[source]¶
Create time-evolving OpenSimplex noise value.
- Parameters:
time – Time offset for seed evolution, default 0
seed – Optional random seed (uses global if None), default None
speed – Seed evolution speed multiplier, default 1
- Returns:
Random float value between 0 and 1
- noisemaker.simplex.simplex(shape, time: int | float = 0, seed: int | None = None, speed: int | float = 1, as_np: bool = False) TypeAliasForwardRef('Tensor') | <MagicMock id='140326739734752'>[source]¶
Generate simplex noise tensor.
- Parameters:
shape – Output tensor shape
time – Time offset for noise evolution, default 0
seed – Optional random seed (uses global if None), default None
speed – Noise evolution speed multiplier, default 1
as_np – Return as NumPy array instead of Tensor, default False
- Returns:
Simplex noise tensor or array with values in range approximately [-1, 1]
noisemaker.util¶
General-purpose helpers used across the Noisemaker codebase.
Utility functions for Noisemaker.
- noisemaker.util.save(tensor: Tensor, name: str = 'noise.png') None[source]¶
Save an image Tensor to a file.
- Parameters:
tensor – Image tensor to save
name – Filename, ending with .png or .jpg
- Returns:
None
- noisemaker.util.load(filename: str, channels: int | None = None) Tensor[source]¶
Load a .png or .jpg by filename.
- Parameters:
filename – Path to the image file
channels – Optional number of channels to force
- Returns:
Loaded image tensor
- noisemaker.util.magick(pattern: str, name: str) Any[source]¶
Create a GIF from frames using
ffmpeg.- Parameters:
pattern – Frame filename pattern (e.g.,
/tmp/dir/*pngor/tmp/dir/%04d.png)name – Output filename
- Returns:
Result of subprocess call
- noisemaker.util.watermark(text: str, filename: str) Any[source]¶
Annotate an image.
- Parameters:
text – Text to add to the image
filename – Image filename to annotate
- Returns:
Result of subprocess call
- noisemaker.util.check_call(command: list[str], quiet: bool = False) Any[source]¶
Execute a subprocess command.
- noisemaker.util.log_subprocess_error(command: str | list[str], e: Exception) None[source]¶
Log subprocess execution errors with appropriate detail.
- Parameters:
command – The command that failed.
e – The exception that was raised.
- noisemaker.util.get_noisemaker_dir() str[source]¶
Get the Noisemaker configuration directory path.
- Returns:
Path to ~/.noisemaker or NOISEMAKER_DIR environment variable.
- noisemaker.util.dumps(kwargs: dict[str, Any]) str[source]¶
Serialize kwargs to JSON, converting Enums to strings.
- Parameters:
kwargs – Dictionary to serialize.
- Returns:
Pretty-printed JSON string with sorted keys.
- noisemaker.util.shape_from_params(width: int, height: int, color_space: ColorSpace, with_alpha: bool) list[int][source]¶
Construct a shape array from image parameters.
- Parameters:
width – Image width in pixels.
height – Image height in pixels.
color_space – Color space (grayscale or color).
with_alpha – Include alpha channel.
- Returns:
Shape list [height, width, channels].
- noisemaker.util.shape_from_file(filename: str) list[int][source]¶
Extract image dimensions from a file using PIL.
Uses PIL to avoid adding operations to the TensorFlow computation graph.
- Parameters:
filename – Path to image file.
- Returns:
Shape list [height, width, channels].