Skip to main content

Overview

iterart is a collection of tools to generate renderings based on iterative functions.

Installation

pip install iterart

Render Functions

Nebulabrot

Examples

from iterart.nebulabrot import nebulabrot
from iterart.shared import Bounds, ImageConfig, BitDepth, DynamicRangeBoost, GPU

gpu = GPU() #You will be prompted to select which GPU to utilize
bounds = Bounds(-2, 2, -2, 2) #Specify the region in the complex plane to render on
image_config = ImageConfig(
    width=1000,
    height=1000,
    bit_depth=BitDepth.EIGHT,
    dynamic_range_boost=DynamicRangeBoost.sqrt #Takes the square root of the final pixel values to improve dynamic range.
)
equation = "z = z**2 + c" # Here we render z = z^2 + c. 

rendering = nebulabrot(
    gpu=gpu,
    image_config=image_config,
    equation=equation,
    step_size=0.001, #A grid scan is performed when choosing values of "c". This is the spacing used.
    max_iter=5000,
    bounds=bounds
)

#Renderings are PIL images, so we can use the "save" method.
rendering.save("render.png")

Equations are written with Python syntax. You have access to 'z' and 'c' variables only. The use of 'i' is also supported since we are dealing with complex numbers. You can access the real and imaginary components of 'z' or 'c' using the 'real' and 'imag' attributes.

Examples:

equation = "z = z**2 + c + z*i"

equation = "z = z**2 + z.imag*i + z.real*i + c"

To produce color renderings, you can combine grayscale renderings into an RGB image. Since renderings are PIL images, we can use tools from that package to accomplish this.

from iterart.nebulabrot import nebulabrot
from iterart.shared import Bounds, ImageConfig, BitDepth, DynamicRangeBoost, GPU
from PIL import Image, ImageEnhance


gpu = GPU()
bounds = Bounds(-2, 2, -2, 2)
image_config = ImageConfig(
    width=1000,
    height=1000,
    bit_depth=BitDepth.EIGHT,
    dynamic_range_boost=DynamicRangeBoost.sqrt
)
equation = """
z = z**2 + c
"""

# Choosing different max iterations will produce slightly different images.
low = nebulabrot(
    gpu=gpu,
    image_config=image_config,
    equation=equation,
    step_size=0.001,
    max_iter=5000,
    bounds=bounds
)

mid = nebulabrot(
    gpu=gpu,
    image_config=image_config,
    equation=equation,
    step_size=0.001,
    max_iter=10000,
    bounds=bounds
)

high = nebulabrot(
    gpu=gpu,
    image_config=image_config,
    equation=equation,
    step_size=0.0015,
    max_iter=20000,
    bounds=bounds
)

image_r = ImageEnhance.Brightness(low).enhance(0.10) #Our goal is an overall blue image, so we can reduce the red channel.
image_g = ImageEnhance.Brightness(Image.blend(mid, high, 0.67)).enhance(0.85) #Green will be made mostly from the higher iteration rendering, which will result in green accents. We also will reduce it overall to still favor a more blue hue.
image_b = Image.blend(low, mid, 0.25)

rgb_image = Image.merge('RGB', (image_r, image_g, image_b))

rgb_image = ImageEnhance.Contrast(rgb_image).enhance(2)
rgb_image = rgb_image.transpose(Image.Transpose.ROTATE_270)

rgb_image.save("color.png")

Attractors

Clifford

from matplotlib import pyplot as plt
import numpy as np
from iterart.attractors import clifford
from iterart.shared import Bounds, ImageConfig, BitDepth, DynamicRangeBoost, GPU
from PIL import Image


gpu = GPU()

bounds = Bounds(-3, 3, -3, 3)
image_config = ImageConfig(
    width=1000,
    height=1000,
    bit_depth=BitDepth.EIGHT,
    dynamic_range_boost=DynamicRangeBoost.log
)

render = clifford(
    gpu=gpu,
    image_config=image_config,
    step_size=0.02, #A grid scan is performed when choosing initial x and y values, this is the spacing used.
    max_iter=10000,
    bounds=bounds,
    a=1.7, b=1.7, c=0.6, d=1.2 #These correspond to the constants of the clifford attractor equations.
)

# Apply colormap from matplotlib (e.g., 'inferno', 'viridis', 'plasma')
image_arr = np.array(render)
colormap = plt.get_cmap("afmhot")
rgba = colormap(image_arr)

# Convert RGBA to RGB (discard the alpha channel)
rgb = (rgba[:, :, :3] * 255).astype(np.uint8)

# Convert back to PIL image
rgb_render = Image.fromarray(rgb)
rgb_render.save("clifford.png")

Metadata

Release files for iterart 1.0.0

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

Source distribution (sdist)

Source distribution for iterart 1.0.0
File Size Uploaded
iterart-1.0.0.tar.gz 9.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for iterart 1.0.0
File Interpreter ABI Platform
iterart-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 18.8 kB

Release files / iterart-1.0.0.tar.gz

Download URL iterart-1.0.0.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
31cf4e66911178f575a5b4a2d3ce893a0f9143386eba9da8e92dcfc0688db2a6
BLAKE2b-256 checksum
How to use checksums
31ec1bb1bcda930cc0025a6f050c2897383f6c82b9994e3252f37effd34b0409
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 17, 2026.

Transparency log

Release files / iterart-1.0.0-py3-none-any.whl

Download URL iterart-1.0.0-py3-none-any.whl
Size 9.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
af3dbe39410cdbfb91e51a3e6d0f6746952c2250e0514aeb9067f07d0db44b7a
BLAKE2b-256 checksum
How to use checksums
219b283c02ed065ca18e94fcaca2258ababd1b2855e4be472826cb08bb54c671
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 17, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page