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¶
Noise generation interface for Noisemaker
-
noisemaker.generators.
basic
(freq, shape, ridges=False, sin=0.0, spline_order=<InterpolationType.bicubic: 3>, distrib=<ValueDistribution.uniform: 1>, corners=False, mask=None, mask_inverse=False, mask_static=False, lattice_drift=0.0, color_space=<ColorSpace.hsv: 21>, hue_range=0.125, hue_rotation=None, saturation=1.0, hue_distrib=None, brightness_distrib=None, brightness_freq=None, saturation_distrib=None, speed=1.0, time=0.0, octave_effects=None, octave=1)[source]¶ Generate a single layer of scaled noise.
Parameters: - freq (int|list[int]) – Base noise frequency. Int, or list of ints for each spatial dimension
- list[int] – Shape of noise. For 2D noise, this is [height, width, channels]
- ridges (bool) – “Crease” at midpoint values: (1 - abs(n * 2 - 1))
- sin (float) – Apply sin function to noise basis
- spline_order (int) – Spline point count. 0=Constant, 1=Linear, 2=Cosine, 3=Bicubic
- distrib (int|str|ValueDistribution) – Type of noise distribution. See
ValueDistribution
enum - corners (bool) – If True, pin values to corners instead of image center
- mask (None|ValueMask) –
- mask_inverse (bool) –
- mask_static (bool) – If True, don’t animate the mask
- lattice_drift (float) – Push away from underlying lattice
- color_space (ColorSpace) –
- hue_range (float) – HSV hue range
- hue_rotation (float|None) – HSV hue bias
- saturation (float) – HSV saturation
- hue_distrib (None|int|str|ValueDistribution) – Override ValueDistribution for hue
- saturation_distrib (None|int|str|ValueDistribution) – Override ValueDistribution for saturation
- brightness_distrib (None|int|str|ValueDistribution) – Override ValueDistribution for brightness
- brightness_freq (None|int|list[int]) – Override frequency for brightness
- speed (float) – Displacement range for Z/W axis (simplex and periodic only)
- time (float) – Time argument for Z/W axis (simplex and periodic only)
Returns: Tensor
-
noisemaker.generators.
multires
(preset, seed, freq=3, shape=None, octaves=1, ridges=False, sin=0.0, spline_order=<InterpolationType.bicubic: 3>, distrib=<ValueDistribution.uniform: 1>, corners=False, mask=None, mask_inverse=False, mask_static=False, lattice_drift=0.0, with_supersample=False, color_space=<ColorSpace.hsv: 21>, hue_range=0.125, hue_rotation=None, saturation=1.0, hue_distrib=None, saturation_distrib=None, brightness_distrib=None, brightness_freq=None, octave_blending=<OctaveBlending.falloff: 0>, octave_effects=None, post_effects=None, with_alpha=False, with_ai=False, final_effects=None, with_upscale=False, stability_model=None, time=0.0, speed=1.0, tensor=None)[source]¶ Generate multi-resolution value noise. For each octave: freq increases, amplitude decreases.
Parameters: - preset (Preset) – The Preset object being rendered
- seed (int) – The current seed (informational only, use value.set_seed to set seed)
- freq (int|list[int]) – Bottom layer frequency. Int, or list of ints for each spatial dimension
- list[int] – Shape of noise. For 2D noise, this is [height, width, channels]
- octaves (int) – Octave count. Number of multi-res layers. Typically 1-8
- ridges (bool) – Per-octave “crease” at midpoint values: (1 - abs(n * 2 - 1))
- post_ridges (bool) – Post-reduce “crease” at midpoint values: (1 - abs(n * 2 - 1))
- sin (float) – Apply sin function to noise basis
- spline_order (int) – Spline point count. 0=Constant, 1=Linear, 2=Cosine, 3=Bicubic
- distrib (int|ValueDistribution) – Type of noise distribution. See
ValueDistribution
enum - corners (bool) – If True, pin values to corners instead of image center
- mask (None|ValueMask) –
- mask_inverse (bool) –
- mask_static (bool) – If True, don’t animate the mask
- lattice_drift (float) – Push away from underlying lattice
- with_supersample (bool) – Use x2 supersampling
- color_space (ColorSpace) –
- hue_range (float) – HSV hue range
- hue_rotation (float|None) – HSV hue bias
- saturation (float) – HSV saturation
- hue_distrib (None|ValueDistribution) – Override ValueDistribution for HSV hue
- saturation_distrib (None|ValueDistribution) – Override ValueDistribution for HSV saturation
- brightness_distrib (None|ValueDistribution) – Override ValueDistribution for HSV brightness
- brightness_freq (None|int|list[int]) – Override frequency for HSV brightness
- octave_blending (OctaveBlendingMethod|int) – Method for flattening octave values
- octave_effects (list[callable]) – A list of composer lambdas to invoke per-octave
- post_effects (list[callable]) – A list of composer lambdas to invoke after flattening layers
- with_alpha (bool) – Include alpha channel
- with_ai (bool) – AI: Apply image-to-image before the final effects pass
- final_effects (list[callable]) – A list of composer lambdas to invoke after everything else
- with_upscale (bool) – AI: x2 upscale final results
- stability_model (str) – AI: Override the default stability.ai model
- speed (float) – Displacement range for Z/W axis (simplex and periodic only)
- time (float) – Time argument for Z/W axis (simplex and periodic only)
Returns: Tensor
noisemaker.value¶
Low-level value noise functions
-
noisemaker.value.
blend
(a, b, g)[source]¶ Blend a and b values with linear interpolation.
Parameters: - a (Tensor) –
- b (Tensor) –
- g (float|Tensor) – Blending gradient a to b (0..1)
Return Tensor:
-
noisemaker.value.
blend_cosine
(a, b, g)[source]¶ Blend a and b values with cosine interpolation.
Parameters: - a (Tensor) –
- b (Tensor) –
- g (float|Tensor) – Blending gradient a to b (0..1)
Return Tensor:
-
noisemaker.value.
blend_cubic
(a, b, c, d, g)[source]¶ Blend b and c values with bi-cubic interpolation.
Parameters: - a (Tensor) –
- b (Tensor) –
- c (Tensor) –
- d (Tensor) –
- g (float|Tensor) – Blending gradient b to c (0..1)
Return Tensor:
-
noisemaker.value.
coerce_enum
(value, cls)[source]¶ Attempt to coerce a given string or int value into an Enum instance.
-
noisemaker.value.
column_index
(shape)[source]¶ Generate a Y index for the given tensor.
[ [ 0, 0, 0, ... ], [ 1, 1, 1, ... ], [ n, n, n, ... ], ... [ height-1, height-1, height-1, ... ] ]
Parameters: shape (list[int]) – Returns: Tensor of shape (height, width)
-
noisemaker.value.
convolve
(tensor, shape, kernel=None, with_normalize=True, alpha=1.0, time=0.0, speed=1.0)[source]¶ Apply a convolution kernel to an image tensor.
image = convolve(image, shape, ValueMask.conv2d_shadow)
Parameters: - tensor (Tensor) – An image tensor.
- shape (list[int]) –
- kernel (ValueMask) – See conv2d_* members in ValueMask enum
- with_normalize (bool) – Normalize output (True)
Paral float alpha: Alpha blending amount
Returns: Tensor
-
noisemaker.value.
distance
(a, b, metric=<DistanceMetric.euclidean: 1>, sdf_sides=5)[source]¶ Compute the distance from a to b, using the specified metric.
Parameters: - a (Tensor) –
- b (Tensor) –
- metric (DistanceMetric|int|str) – Distance metric
Returns: Tensor
-
noisemaker.value.
freq_for_shape
(freq, shape)[source]¶ Given a base frequency as int, generate noise frequencies for each spatial dimension.
Parameters: - freq (int) – Base frequency
- shape (list[int]) – List of spatial dimensions, e.g. [height, width]
-
noisemaker.value.
normalize
(tensor, signed_range=False)[source]¶ Squeeze the given Tensor into a range between 0 and 1.
Parameters: - tensor (Tensor) – An image tensor.
- signed_range (bool) – Use a range between -1 and 1.
Returns: Tensor
-
noisemaker.value.
periodic_value
(time, value)[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 (float) –
- value (float|Tensor) –
-
noisemaker.value.
pin_corners
(tensor, shape, freq, corners)[source]¶ Pin values to image corners, or align with image center, as per the given “corners” arg.
-
noisemaker.value.
proportional_downsample
(tensor, shape, new_shape)[source]¶ Given a new shape which is evenly divisible by the old shape, shrink the image by averaging pixel values.
Parameters: - tensor (Tensor) –
- shape (list[int]) –
- new_shape (list[int]) –
-
noisemaker.value.
refract
(tensor, shape, displacement=0.5, reference_x=None, reference_y=None, warp_freq=None, spline_order=<InterpolationType.bicubic: 3>, from_derivative=False, signed_range=True, time=0.0, speed=1.0, y_from_offset=False)[source]¶ Apply displacement from pixel values.
Parameters: - tensor (Tensor) – An image tensor.
- shape (list[int]) –
- displacement (float) –
- reference_x (Tensor) – An optional horizontal displacement map.
- reference_y (Tensor) – An optional vertical displacement map.
- warp_freq (list[int]) – If given, generate new reference_x and reference_y noise with this base frequency.
- spline_order (int) – Interpolation for warp effect only. 0=Constant, 1=Linear, 2=Cosine, 3=Bicubic
- from_derivative (bool) – If True, generate X and Y offsets from noise derivatives.
- signed_range (bool) – Scale displacement values from -1..1 instead of 0..1
- y_from_offset (bool) – If True, derive Y offsets from offsetting the image
Returns: Tensor
-
noisemaker.value.
resample
(tensor, shape, spline_order=3)[source]¶ Resize an image tensor to the specified shape.
Parameters: - tensor (Tensor) –
- shape (list[int]) –
- spline_order (int) – Spline point count. 0=Constant, 1=Linear, 2=Cosine, 3=Bicubic
Returns: Tensor
-
noisemaker.value.
ridge
(tensor)[source]¶ Create a “ridge” at midpoint values. 1 - abs(n * 2 - 1)
Parameters: tensor (Tensor) – An image tensor. Returns: Tensor
-
noisemaker.value.
row_index
(shape)[source]¶ Generate an X index for the given tensor.
[ [ 0, 1, 2, ... width-1 ], [ 0, 1, 2, ... width-1 ], ... (x height) ]
Parameters: shape (list[int]) – Returns: Tensor of shape (height, width)
-
noisemaker.value.
simple_multires
(freq, shape, octaves=1, spline_order=<InterpolationType.bicubic: 3>, distrib=<ValueDistribution.uniform: 1>, corners=False, ridges=False, mask=None, mask_inverse=False, mask_static=False, time=0.0, speed=1.0)[source]¶ Generate multi-octave value noise. Unlike generators.multires, this function is single-channel and does not apply effects.
-
noisemaker.value.
singularity
(tensor, shape, diagram_type=<VoronoiDiagramType.range: 11>, **kwargs)[source]¶ Return the range diagram for a single voronoi point, approximately centered.
Parameters: - tensor (Tensor) –
- shape (list[int]) –
- diagram_type (VoronoiDiagramType|int) –
- dist_metric (DistanceMetric|int) –
Additional kwargs will be sent to the voronoi metric.
-
noisemaker.value.
value_map
(tensor, shape, keepdims=False, signed_range=False, with_normalize=True)[source]¶ Create a grayscale value map from the given image Tensor, based on apparent luminance.
Return value ranges between 0 and 1.
Parameters: - tensor (Tensor) –
- shape (list[int]) –
- keepdims (bool) – If True, don’t collapse the channel dimension.
- signed_range (bool) – If True, use an extended value range between -1 and 1.
Returns: Tensor of shape (height, width), or (height, width, channels) if keepdims was True.
-
noisemaker.value.
values
(freq, shape, distrib=<ValueDistribution.uniform: 1>, corners=False, mask=None, mask_inverse=False, mask_static=False, spline_order=<InterpolationType.bicubic: 3>, time=0.0, speed=1.0)[source]¶
-
noisemaker.value.
voronoi
(tensor, shape, diagram_type=<VoronoiDiagramType.range: 11>, nth=0, dist_metric=<DistanceMetric.euclidean: 1>, sdf_sides=3, alpha=1.0, with_refract=0.0, inverse=False, xy=None, ridges_hint=False, refract_y_from_offset=True, time=0.0, speed=1.0, point_freq=3, point_generations=1, point_distrib=<PointDistribution.random: 1000000>, point_drift=0.0, point_corners=False, downsample=True)[source]¶ Create a voronoi diagram, blending with input image Tensor color values.
Parameters: - tensor (Tensor) –
- shape (list[int]) –
- diagram_type (VoronoiDiagramType|int) – Diagram type (0=Off, 1=Range, 2=Color Range, 3=Indexed, 4=Color Map, 5=Blended, 6=Flow)
- nth (float) – Plot Nth nearest neighbor, or -Nth farthest
- dist_metric (DistanceMetric|int) – Voronoi distance metric
- regions (bool) – Assign colors to control points (memory intensive)
- alpha (float) – Blend with original tensor (0.0 = Original, 1.0 = Voronoi)
- with_refract (float) – Domain warp input tensor against resulting voronoi
- inverse (bool) – Invert range brightness values (does not affect hue)
- Tensor, int) xy ((Tensor,) – Bring your own x, y, and point count (You shouldn’t normally need this)
- ridges_hint (float) – Adjust output colors to match ridged multifractal output (You shouldn’t normally need this)
- downsample (bool) – Use a downsampled distance field, probably to conserve memory
Returns: Tensor
noisemaker.effects¶
Low-level effects library for Noisemaker
-
noisemaker.effects.
aberration
(tensor, shape, displacement=0.005, time=0.0, speed=1.0)[source]¶ Chromatic aberration
Parameters: - tensor (Tensor) –
- shape (list[int]) –
- displacement (float) –
-
noisemaker.effects.
bloom
(tensor, shape, alpha=0.5, time=0.0, speed=1.0)[source]¶ Bloom effect
Input image must currently be square (sorry).
Parameters: - tensor (Tensor) –
- shape (list[int]) –
- alpha (float) –
-
noisemaker.effects.
blur
(tensor, shape, amount=10.0, spline_order=<InterpolationType.bicubic: 3>, time=0.0, speed=1.0)[source]¶
-
noisemaker.effects.
center_mask
(center, edges, shape, dist_metric=<DistanceMetric.chebyshev: 3>, power=2)[source]¶ Blend two image tensors from the center to the edges.
Parameters: - center (Tensor) –
- edges (Tensor) –
- shape (list[int]) –
- power (int) –
Returns: Tensor
-
noisemaker.effects.
color_map
(tensor, shape, clut=None, horizontal=False, displacement=0.5, time=0.0, speed=1.0)[source]¶ Apply a color map to an image tensor.
The color map can be a photo or whatever else.
Parameters: - tensor (Tensor) –
- shape (list[int]) –
- clut (Tensor|str) – An image tensor or filename (png/jpg only) to use as a color palette
- horizontal (bool) – Scan horizontally
- displacement (float) – Gather distance for clut
-
noisemaker.effects.
conv_feedback
(tensor, shape, iterations=50, alpha=0.5, time=0.0, speed=1.0)[source]¶ Conv2d feedback loop
Parameters: tensor (Tensor) – Returns: Tensor
-
noisemaker.effects.
crt
(tensor, shape, time=0.0, speed=1.0)[source]¶ Apply vintage CRT scanlines.
Parameters: - tensor (Tensor) –
- shape (list[int]) –
-
noisemaker.effects.
density_map
(tensor, shape, time=0.0, speed=1.0)[source]¶ Create a binned pixel value density map.
Parameters: - tensor (Tensor) –
- shape (list[int]) –
-
noisemaker.effects.
derivative
(tensor, shape, dist_metric=<DistanceMetric.euclidean: 1>, with_normalize=True, alpha=1.0, time=0.0, speed=1.0)[source]¶ Extract a derivative from the given noise.
Parameters: - tensor (Tensor) –
- shape (list[int]) –
- dist_metric (DistanceMetric|int) – Derivative distance metric
- with_normalize (bool) –
Returns: Tensor
-
noisemaker.effects.
dla
(tensor, shape, padding=2, seed_density=0.01, density=0.125, xy=None, alpha=1.0, time=0.0, speed=1.0)[source]¶ Diffusion-limited aggregation. Slow.
Parameters: - tensor (Tensor) –
- shape (list[int]) –
- padding (int) –
- seed_density (float) –
- density (float) –
- xy (None|Tensor) – Pre-seeded point cloud (optional)
-
noisemaker.effects.
erosion_worms
(tensor, shape, density=50, iterations=50, contraction=1.0, alpha=0.25, inverse=False, xy_blend=False, time=0.0, speed=1.0)[source]¶ WIP hydraulic erosion effect.
-
noisemaker.effects.
false_color
(tensor, shape, horizontal=False, displacement=0.5, time=0.0, speed=1.0)[source]¶
-
noisemaker.effects.
glitch
(tensor, shape, time=0.0, speed=1.0)[source]¶ Apply a glitch effect.
Parameters: - tensor (Tensor) –
- shape (list[int]) –
Returns: Tensor
-
noisemaker.effects.
glowing_edges
(tensor, shape, sobel_metric=2, alpha=1.0, time=0.0, speed=1.0)[source]¶
-
noisemaker.effects.
glyph_map
(tensor, shape, mask=None, colorize=True, zoom=1, alpha=1.0, spline_order=<InterpolationType.constant: 0>, time=0.0, speed=1.0)[source]¶ Parameters: - tensor (Tensor) –
- shape (list[int]) –
- mask (ValueMask|None) –
-
noisemaker.effects.
jpeg_decimate
(tensor, shape, iterations=25, time=0.0, speed=1.0)[source]¶ Destroy an image with the power of JPEG
Parameters: tensor (Tensor) – Returns: Tensor
-
noisemaker.effects.
kaleido
(tensor, shape, sides=6, sdf_sides=5, xy=None, blend_edges=True, time=0.0, speed=1.0, point_freq=1, point_generations=1, point_distrib=<PointDistribution.random: 1000000>, point_drift=0.0, point_corners=False)[source]¶ Adapted from https://github.com/patriciogonzalezvivo/thebookofshaders/blob/master/15/texture-kaleidoscope.frag
Parameters: - tensor (Tensor) –
- shape (list[int]) –
- sides (int) – Number of sides
- dist_metric (DistanceMetric) –
- xy – Optional (x, y) coordinates for points
- blend_edges (bool) – Blend with original edge indices
-
noisemaker.effects.
lowpoly
(tensor, shape, distrib=<PointDistribution.random: 1000000>, freq=10, time=0.0, speed=1.0, dist_metric=<DistanceMetric.euclidean: 1>)[source]¶ Low-poly art style effect
-
noisemaker.effects.
normal_map
(tensor, shape, time=0.0, speed=1.0)[source]¶ Generate a tangent-space normal map.
Parameters: - tensor (Tensor) –
- shape (list[int]) –
Returns: Tensor
-
noisemaker.effects.
offset_index
(y_index, height, x_index, width)[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 (Tensor) – Tensor with shape [height, width, 1], containing Y indices
- height (int) –
- x_index (Tensor) – Tensor with shape [height, width, 1], containing X indices
- width (int) –
Returns: Tensor
-
noisemaker.effects.
outline
(tensor, shape, sobel_metric=1, invert=False, time=0.0, speed=1.0)[source]¶ Superimpose sobel operator results (cartoon edges)
Parameters: - tensor (Tensor) –
- shape (list[int]) –
- sobel_metric (DistanceMetric|int) – Sobel distance metric
-
noisemaker.effects.
palette
(tensor, shape, name=None, alpha=1.0, time=0.0, speed=1.0)[source]¶ Another approach to image coloration https://iquilezles.org/www/articles/palettes/palettes.htm
-
noisemaker.effects.
pixel_sort
(tensor, shape, angled=False, darkest=False, time=0.0, speed=1.0)[source]¶ Pixel sort effect
Parameters: - tensor (Tensor) –
- shape (list[int]) –
- angled (bool) – If True, sort along a random angle.
- darkest (bool) – If True, order by darkest instead of brightest
Return Tensor:
-
noisemaker.effects.
post_process
(tensor, shape, freq, ridges_hint=False, spline_order=<InterpolationType.bicubic: 3>, reflect_range=0.0, refract_range=0.0, reindex_range=0.0, refract_y_from_offset=False, refract_signed_range=False, clut=None, clut_horizontal=False, clut_range=0.5, with_worms=None, worms_density=4.0, worms_duration=4.0, worms_stride=1.0, worms_stride_deviation=0.05, worms_alpha=0.5, worms_kink=1.0, worms_drunkenness=0.0, with_sobel=None, with_normal_map=False, deriv=None, deriv_alpha=1.0, with_outline=False, with_glowing_edges=False, with_wormhole=False, wormhole_kink=2.5, wormhole_stride=0.1, wormhole_alpha=1.0, with_voronoi=0, voronoi_nth=0, voronoi_metric=<DistanceMetric.euclidean: 1>, voronoi_alpha=1.0, voronoi_refract=0.0, voronoi_inverse=False, voronoi_sdf_sides=5, voronoi_refract_y_from_offset=True, posterize_levels=0, with_erosion_worms=False, erosion_worms_density=50, erosion_worms_iterations=50, erosion_worms_contraction=1.0, erosion_worms_alpha=1.0, erosion_worms_inverse=False, erosion_worms_xy_blend=None, warp_range=0.0, warp_octaves=3, warp_interp=None, warp_freq=None, warp_map=None, warp_signed_range=True, ripple_range=0.0, ripple_freq=None, ripple_kink=1.0, vortex_range=0.0, with_aberration=None, with_dla=0.0, dla_padding=2, point_freq=5, point_distrib=1000000, point_corners=False, point_generations=1, point_drift=0.0, with_bloom=None, with_reverb=None, reverb_iterations=1, reverb_ridges=True, with_light_leak=None, with_vignette=None, vignette_brightness=0.0, with_vaseline=0.0, post_hue_rotation=None, post_saturation=None, post_brightness=None, post_contrast=None, with_ridge=False, with_jpeg_decimate=None, with_conv_feedback=None, conv_feedback_alpha=0.5, with_density_map=False, with_glyph_map=None, glyph_map_colorize=True, glyph_map_zoom=1.0, glyph_map_alpha=1.0, with_composite=None, composite_zoom=4.0, with_sort=False, sort_angled=False, sort_darkest=False, with_convolve=None, with_shadow=None, with_sketch=False, with_lowpoly=False, lowpoly_distrib=1000000, lowpoly_freq=10, lowpoly_metric=<DistanceMetric.euclidean: 1>, angle=None, with_simple_frame=False, with_kaleido=None, kaleido_sdf_sides=0, kaleido_blend_edges=True, with_wobble=None, with_palette=None, with_glitch=False, with_vhs=False, with_crt=False, with_scan_error=False, with_snow=False, with_grain=False, with_nebula=False, with_false_color=False, with_frame=False, with_scratches=False, with_fibers=False, with_stray_hair=False, with_grime=False, with_watermark=False, with_ticker=False, with_texture=False, with_pre_spatter=False, with_spatter=False, with_clouds=False, with_lens_warp=None, with_tint=None, with_degauss=False, color_space=<ColorSpace.hsv: 21>, time=0.0, speed=1.0, **_)[source]¶ Apply post-processing effects.
Parameters: - tensor (Tensor) –
- shape (list[int]) –
- freq (list[int]) –
- spline_order (int) – Ortho spline point count (0=Constant, 1=Linear, 2=Cosine, 3=Bicubic)
- reflect_range (float) – Derivative distortion gradient.
- refract_range (float) – Self-distortion gradient.
- refract_y_from_offset (float) – Derive Y offset values from offsetting the image.
- reindex_range (float) – Self-reindexing gradient.
- clut (str) – PNG or JPG color lookup table filename.
- clut_horizontal (float) – Preserve clut Y axis.
- clut_range (float) – Gather range for clut.
- with_worms (WormBehavior|None) – Do worms.
- worms_density (float) – Worm density multiplier (larger == slower)
- worms_duration (float) – Iteration multiplier (larger == slower)
- worms_stride (float) – Mean travel distance per iteration
- worms_stride_deviation (float) – Per-worm travel distance deviation
- worms_alpha (float) – Fade worms (0..1)
- worms_kink (float) – Worm twistiness
- sobel (DistanceMetric|int) – Sobel operator distance metric
- outline (DistanceMetric|int) – Outlines distance metric (multiply)
- with_normal_map (bool) – Create a tangent-space normal map
- with_wormhole (bool) – Wormhole effect. What is this?
- wormhole_kink (float) – Wormhole kinkiness, if you’re into that.
- wormhole_stride (float) – Wormhole thickness range
- wormhole_alpha (float) – Wormhole alpha blending
- with_voronoi (VoronoiDiagramType|int) – Voronoi diagram type (0=Off, 1=Range, 2=Color Range, 3=Indexed, 4=Color Map, 5=Blended, 6=Flow)
- voronoi_nth (int) – Voronoi Nth nearest
- voronoi_metric (DistanceMetric|int) – Voronoi distance metric
- voronoi_alpha (float) – Blend with original tensor (0.0 = Original, 1.0 = Voronoi)
- voronoi_refract (float) – Domain warp input tensor against Voronoi
- voronoi_refract_y_from_offset (bool) – Derive Y offsets from offsetting image
- voronoi_inverse (bool) – Inverse values for Voronoi ‘range’ types
- voronoi_sdf_sides (bool) – Number of sides for Voronoi when using DistanceMetric.sdf
- ridges_hint (bool) – Ridged multifractal hint for Voronoi
- deriv (DistanceMetric|int) – Derivative distance metric
- deriv_alpha (float) – Derivative alpha blending amount
- posterize_levels (float) – Posterize levels
- with_erosion_worms (bool) – Erosion worms
- erosion_worms_density (float) – Default: 50
- erosion_worms_iterations (float) – Default: 50
- erosion_worms_contraction (float) – Inverse of stride. Default: 1.0, smaller=longer steps
- erosion_worms_alpha (float) –
- erosion_worms_inverse (bool) –
- erosion_worms_xy_blend (None|float) –
- vortex_range (float) – Vortex tiling amount
- warp_range (float) – Orthogonal distortion gradient.
- warp_octaves (int) – Multi-res iteration count for warp
- warp_interp (int|None) – Override spline order for warp (None = use spline_order)
- warp_freq (int|None) – Override frequency for warp (None = use freq)
- warp_map (str|None) – File with brightness values for warp (None = generate noise)
- ripple_range (float) – Ripple range
- ripple_freq (float) – Ripple frequency
- ripple_kink (float) – Ripple twistiness
- with_aberration (float|None) – Chromatic aberration distance
- with_bloom (float|None) – Bloom alpha
- with_dla (bool) – Diffusion-limited aggregation alpha
- dla_padding (int) – DLA pixel padding
- point_freq (int) – Voronoi and DLA point frequency (freq * freq = count)
- point_distrib (PointDistribution|ValueMask|int) – Voronoi and DLA point cloud distribution
- point_corners (bool) – Pin Voronoi and DLA points to corners (False = pin to center)
- point_generations (int) – Penrose-ish generations. Keep it low, and keep freq low, or you will run OOM easily.
- point_drift (float) – Fudge point locations (1.0 = nearest neighbor)
- with_reverb (None|int) – Reverb octave count
- reverb_iterations (int) – Re-reverberation N times
- reverb_ridges (bool) – Ridged reverb layers (False to disable)
- with_light_leak (None|float) – Light leak effect alpha
- with_vignette (None|float) – Vignette effect alpha
- vignette_brightness (None|float) – Vignette effect brightness
- post_hue_rotation (None|float) – Rotate hue (-.5 - .5)
- post_saturation (None|float) – Adjust saturation (0 - 1)
- post_brightness (None|float) – Adjust brightness
- post_contrast (None|float) – Adjust contrast
- with_ridge (bool) – Crease at midpoint values
- with_shadow (None|float) – Sobel-based shading alpha
- with_jpeg_decimate (None|int) – Conv2D feedback + JPEG encode/decode iteration count
- with_conv_feedback (None|int) – Conv2D feedback iterations
- conv_feedback_alpha (float) – Conv2D feedback alpha
- with_density_map (bool) – Map values to color histogram
- with_glyph_map (ValueMask|None) – Map values to glyph brightness. Square masks only for now
- glyph_map_colorize (bool) – Colorize glyphs from on average input colors
- glyph_map_zoom (float) – Scale glyph output
- glyph_map_alpha (float) – Fade glyph output
- with_composite (None|ValueMask) – Composite video effect
- composite_zoom (float) – Composite subpixel scaling
- with_sort (bool) – Pixel sort
- sort_angled (bool) – Pixel sort along a random angle
- sort_darkest (bool) – Pixel sort order by darkest instead of brightest
- convolve (None|list[str|ValueMask]) – List of ValueMasks to apply as convolution kernels
- with_sketch (bool) – Pencil sketch effect
- with_lowpoly (bool) – Low-poly art effect
- lowpoly_distrib (PointDistribution) – Point distribution for low-poly art effect
- lowpoly_freq (int) – Point frequency for low-poly art effect
- lowpoly_metric (DistanceMetric) – Low-poly effect distance metric
- angle (None|float) – Rotation angle
- with_simple_frame (None|bool) –
- with_kaleido (None|int) – Number of kaleido reflection sides
- kaleido_sdf_sides (None|DistanceMetric) – Number of kaleido shape sides
- kaleido_blend_edges (bool) – Blend Kaleido with original edge indices
- with_wobble (None|float) – Move entire image around
- with_palette (None|str) – Apply named cosine palette
- with_glitch (bool) – Glitch effect (Bit shit)
- with_vhs (bool) – VHS effect (Shitty tracking)
- with_crt (bool) – Vintage TV effect
- with_scan_error (bool) – Horizontal scan error
- with_snow (float) – Analog broadcast snow
- with_grain (float) – Per-pixel brightness jitter
- with_frame (bool) – Shitty instant camera effect
- with_nebula (bool) – Add clouds
- with_false_color (bool) – Swap colors with basic noise
- with_watermark (bool) – Stylized digital watermark effect
- with_ticker (bool) – With spooky ticker effect
- with_scratches (bool) – Scratched film effect
- with_fibers (bool) – Old-timey paper fibers
- with_texture (bool) – Bumpy canvas
- with_pre_spatter (bool) – Spatter mask (early pass)
- with_spatter (bool) – Spatter mask
- with_clouds (bool) – Cloud cover
- with_lens_warp (None|float) – Lens warp effect
- with_tint (None|float) – Color tint effect alpha amount
- with_degauss (None|float) – CRT degauss effect
- color_space (ColorSpace) –
Returns: Tensor
-
noisemaker.effects.
posterize
(tensor, shape, levels=9, time=0.0, speed=1.0)[source]¶ Reduce the number of color levels per channel.
Parameters: - tensor (Tensor) –
- levels (int) –
Returns: Tensor
-
noisemaker.effects.
reindex
(tensor, shape, displacement=0.5, time=0.0, speed=1.0)[source]¶ Re-color the given tensor, by sampling along one axis at a specified frequency.
Parameters: - tensor (Tensor) – An image tensor.
- shape (list[int]) –
- displacement (float) –
Returns: Tensor
-
noisemaker.effects.
reverb
(tensor, shape, octaves=2, iterations=1, ridges=True, time=0.0, speed=1.0)[source]¶ Multi-octave “reverberation” of input image tensor
Parameters: - tensor (Tensor) –
- shape (float[int]) –
- octaves (int) –
- iterations (int) – Re-reverberate N times. Gratuitous!
- ridges (bool) – abs(tensor * 2 - 1) – False to not do that.
-
noisemaker.effects.
ripple
(tensor, shape, freq=2, displacement=1.0, kink=1.0, reference=None, spline_order=<InterpolationType.bicubic: 3>, time=0.0, speed=1.0)[source]¶ Apply displacement from pixel radian values.
Parameters: - tensor (Tensor) – An image tensor.
- shape (list[int]) –
- freq (list[int]) – Displacement frequency
- displacement (float) –
- kink (float) –
- reference (Tensor) – An optional displacement map.
- spline_order (int) – Ortho offset spline point count. 0=Constant, 1=Linear, 2=Cosine, 3=Bicubic
Returns: Tensor
-
noisemaker.effects.
rotate
(tensor, shape, angle=None, time=0.0, speed=1.0)[source]¶ Rotate the image. This breaks seamless edges.
-
noisemaker.effects.
shadow
(tensor, shape, alpha=1.0, reference=None, time=0.0, speed=1.0)[source]¶ Convolution-based self-shadowing effect.
Parameters: - tensor (Tensor) –
- shape (list[int]) –
- alpha (float) –
- reference (None|Tensor) – Alternate reference values with shape (height, width)
-
noisemaker.effects.
sketch
(tensor, shape, time=0.0, speed=1.0)[source]¶ Pencil sketch effect
Parameters: - tensor (Tensor) –
- shape (list[int]) –
Return Tensor:
-
noisemaker.effects.
sobel
(tensor, shape, dist_metric=1, rgb=False)[source]¶ Colorized sobel edges.
Parameters: - tensor (Tensor) –
- shape (list[int]) –
- dist_metric (DistanceMetric|int) – Sobel distance metric
- rgb (bool) –
-
noisemaker.effects.
sobel_operator
(tensor, shape, dist_metric=<DistanceMetric.euclidean: 1>, time=0.0, speed=1.0)[source]¶ Apply a sobel operator.
Parameters: - tensor (Tensor) –
- shape (list[int]) –
- dist_metric (DistanceMetric|int) – Sobel distance metric
Returns: Tensor
-
noisemaker.effects.
square_crop_and_resize
(tensor, shape, length=1024)[source]¶ Crop and resize an image Tensor into a square with desired side length.
Parameters: - tensor (Tensor) –
- shape (list[int]) –
- length (int) – Desired side length
Return Tensor:
-
noisemaker.effects.
value_refract
(tensor, shape, freq=4, distrib=<ValueDistribution.center_circle: 20>, displacement=0.125, time=0.0, speed=1.0)[source]¶
-
noisemaker.effects.
vhs
(tensor, shape, time=0.0, speed=1.0)[source]¶ Apply a bad VHS tracking effect.
Parameters: - tensor (Tensor) –
- shape (list[int]) –
Returns: Tensor
-
noisemaker.effects.
vortex
(tensor, shape, displacement=64.0, time=0.0, speed=1.0)[source]¶ Vortex tiling effect
Parameters: - tensor (Tensor) –
- shape (list[int]) –
- displacement (float) –
-
noisemaker.effects.
warp
(tensor, shape, freq=2, octaves=5, displacement=1, spline_order=<InterpolationType.bicubic: 3>, warp_map=None, signed_range=True, time=0.0, speed=1.0)[source]¶ Multi-octave warp effect
Parameters: - tensor (Tensor) –
- shape (list[int]) –
- freq (list[int]) –
- octaves (int) –
- displacement (float) –
- spline_order (int) –
- warp_map (str|None) –
- signed_range (bool) –
- time (float) –
- speed (float) –
-
noisemaker.effects.
wormhole
(tensor, shape, kink=1.0, input_stride=1.0, alpha=1.0, time=0.0, speed=1.0)[source]¶ Apply per-pixel field flow. Non-iterative.
Parameters: - tensor (Tensor) –
- shape (list[int]) –
- kink (float) – Path twistiness
- input_stride (float) – Maximum pixel offset
Returns: Tensor
-
noisemaker.effects.
worms
(tensor, shape, behavior=1, density=4.0, duration=4.0, stride=1.0, stride_deviation=0.05, alpha=0.5, kink=1.0, drunkenness=0.0, quantize=False, colors=None, time=0.0, speed=1.0)[source]¶ Make a furry patch of worms which follow field flow rules.
Parameters: - tensor (Tensor) –
- shape (list[int]) –
- behavior (int|WormBehavior) –
- density (float) – Worm density multiplier (larger == slower)
- duration (float) – Iteration multiplier (larger == slower)
- stride (float) – Mean travel distance per iteration
- stride_deviation (float) – Per-worm travel distance deviation
- alpha (float) – Fade worms (0..1)
- kink (float) – Make your worms twist.
- drunkenness (float) – Randomly fudge angle at each step (1.0 = 360 degrees)
- quantize (bool) – Quantize rotations to 45 degree increments
- colors (Tensor) – Optional starting colors, if not from tensor.
Returns: Tensor
noisemaker.composer¶
Extremely high-level interface for composable noise presets. See detailed docs.
-
noisemaker.composer.
Effect
(effect_name, **kwargs)[source]¶ Return a partial effects function. Invoke the wrapped function with params “tensor”, “shape”, “time”, and “speed.”
-
class
noisemaker.composer.
SettingsDict
(*args, **kwargs)[source]¶ Bases:
collections.UserDict
dict, but it makes sure the caller eats everything on their plate.
-
exception
noisemaker.composer.
UnusedKeys
[source]¶ Bases:
Exception
Exception raised when a preset has keys that aren’t being used.
-
noisemaker.composer.
enum_range
(a, b)[source]¶ Return a list of enum members within the specified inclusive numeric value range.
-
noisemaker.composer.
random_member
(*collections)[source]¶ Return a random member from a collection, enum list, or enum. Ensures deterministic ordering.
noisemaker.constants¶
Constants used in Noisemaker
-
class
noisemaker.constants.
ColorSpace
[source]¶ Bases:
enum.Enum
-
grayscale
= 1¶
-
hsv
= 21¶
-
oklab
= 31¶
-
rgb
= 11¶
-
-
class
noisemaker.constants.
DistanceMetric
[source]¶ Bases:
enum.Enum
Specify the distance metric used in various operations, such as Voronoi cells, derivatives, and sobel operators.
-
absolute_members
= <bound method DistanceMetric.absolute_members of <enum 'DistanceMetric'>>[source]¶
-
chebyshev
= 3¶
-
euclidean
= 1¶
-
hexagram
= 102¶
-
manhattan
= 2¶
-
none
= 0¶
-
octagram
= 4¶
-
sdf
= 201¶
-
triangular
= 101¶
-
-
class
noisemaker.constants.
InterpolationType
[source]¶ Bases:
enum.Enum
Specify the spline point count for interpolation operations.
-
bicubic
= 3¶
-
constant
= 0¶
-
cosine
= 2¶
-
linear
= 1¶
-
-
class
noisemaker.constants.
OctaveBlending
[source]¶ Bases:
enum.Enum
Specify the mode for flattening octaves.
-
alpha
= 20¶
-
falloff
= 0¶
-
reduce_max
= 10¶
-
-
class
noisemaker.constants.
PointDistribution
[source]¶ Bases:
enum.Enum
Point cloud distribution, used by Voronoi and DLA
-
chess
= 1000003¶
-
circular
= 1000100¶
-
circular_members
= <bound method PointDistribution.circular_members of <enum 'PointDistribution'>>[source]¶
-
concentric
= 1000101¶
-
h_hex
= 1000010¶
-
random
= 1000000¶
-
rotating
= 1000102¶
-
spiral
= 1000050¶
-
square
= 1000001¶
-
v_hex
= 1000011¶
-
waffle
= 1000002¶
-
-
class
noisemaker.constants.
ValueDistribution
[source]¶ Bases:
enum.Enum
Specify the value distribution function for basic noise.
image = basic(freq, [height, width, channels], distrib=ValueDistribution.uniform)
-
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¶
-
is_center_distance
= <bound method ValueDistribution.is_center_distance of <enum 'ValueDistribution'>>[source]¶
-
is_native_size
= <bound method ValueDistribution.is_native_size of <enum 'ValueDistribution'>>[source]¶
-
mids
= 6¶
-
ones
= 5¶
-
row_index
= 11¶
-
scan_down
= 41¶
-
scan_left
= 42¶
-
scan_right
= 43¶
-
scan_up
= 40¶
-
uniform
= 1¶
-
zeros
= 7¶
-
-
class
noisemaker.constants.
ValueMask
[source]¶ Bases:
enum.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¶
-
nonprocedural_members
= <bound method ValueMask.nonprocedural_members of <enum 'ValueMask'>>[source]¶
-
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.
VoronoiDiagramType
[source]¶ Bases:
enum.Enum
Specify the artistic rendering function used for Voronoi diagrams.
-
color_flow
= 42¶ Density-mapped flow diagram
-
color_range
= 12¶ Normalized neighbor distances blended with input Tensor
-
color_regions
= 22¶ Color-mapped regions
-
flow
= 41¶ Edgeless voronoi. Natural logarithm of reduced distance sums.
-
flow_members
= <bound method VoronoiDiagramType.flow_members of <enum 'VoronoiDiagramType'>>[source]¶
-
is_flow_member
= <bound method VoronoiDiagramType.is_flow_member of <enum 'VoronoiDiagramType'>>[source]¶
-
none
= 0¶ No Voronoi
-
range
= 11¶ Normalized neighbor distances
-
range_regions
= 31¶ Colorized neighbor distances blended with color-mapped regions
-
regions
= 21¶ Indexed regions
-
noisemaker.util¶
Utility functions for Noisemaker.
-
noisemaker.util.
load
(filename, channels=None)[source]¶ Load a .png or .jpg by filename.
Parameters: filename (str) – Returns: Tensor
-
noisemaker.util.
magick
(glob, name)[source]¶ Shell out to ImageMagick’s “convert” (im6) or “magick” (im7) commands for GIF composition, depending on what’s available.
Parameters: - glob (str) – Frame filename glob pattern
- name (str) – Filename
-
noisemaker.util.
save
(tensor, name='noise.png')[source]¶ Save an image Tensor to a file.
Parameters: - tensor (Tensor) – Image tensor
- name (str) – Filename, ending with .png or .jpg
Returns: None
noisemaker.presets¶
-
noisemaker.presets.
PRESETS
()¶ Composable presets for Noisemaker. See composer.py and https://noisemaker.readthedocs.io/en/latest/composer.html