Skip to main content

rLIC

PyPI Conda Version

Line Integral Convolution for Python, written in Rust

rLIC (pronounced 'relic') is a highly optimized, minimal implementation of the Line Integral Convolution algorithm for in-memory numpy arrays, written in Rust.

Development status and scope

rLIC is currently in beta. As of version 0.5.0, the only public API, rlic.convolve, is considered feature complete and stable. However, minor behavior changes may still happen, particularly where performance can be improved as a result.

Post-processing is out-of-scope for this library. For histogram equalization, an operation very commonly applied to LIC images, please see rLIC's sister project ahe, which follows the same minimalist philosophy and originated within rLIC's code base.

Free-threading support

rlic.convolve is trivially thread-safe, because it does not mutate any external data. As of version 0.5.1, Wheels are not yet distributed for free-threaded CPython, but this build target is still supported and tested.

Installation

python -m pip install rLIC

Examples

rLIC consists in a single Python function, rlic.convolve, that convolves a texture image (usually noise) with a 2D vector field described by its components u and v, via a 1D kernel array. The result is an image where pixel intensity is strongly correlated along field lines.

Let's see an example. We'll use matplotlib to visualize inputs and outputs.

import matplotlib.pyplot as plt
import numpy as np

import rlic

SHAPE = NX, NY = (256, 256)
prng = np.random.default_rng(0)

texture = prng.random(SHAPE)
x = np.linspace(0, np.pi, NY)
U = np.broadcast_to(np.cos(2 * x), SHAPE)
V = np.broadcast_to(np.sin(x).T, SHAPE)

fig, axs = plt.subplots(ncols=2, sharex=True, sharey=True, figsize=(10, 5))
for ax in axs:
    ax.set(aspect="equal", xticks=[], yticks=[])

ax = axs[0]
ax.set_title("Input texture (noise)")
ax.imshow(texture)

ax = axs[1]
ax.set_title("Input vector field")
Y, X = np.mgrid[0:NY, 0:NX]
ax.streamplot(X, Y, U, V)

Now let's compute some convolutions, varying the number of iterations

kernel = 1 - np.abs(np.linspace(-1, 1, 65))

fig_out, axs_out = plt.subplots(ncols=3, figsize=(15, 5))
for ax in axs_out:
    ax.set(aspect="equal", xticks=[], yticks=[])
for n, ax in zip((1, 5, 100), axs_out, strict=True):
    image = rlic.convolve(
        texture,
        U,
        V,
        kernel=kernel,
        boundaries="periodic",
        iterations=n,
    )
    ax.set_title(f"Convolution result ({n} iteration(s))")
    ax.imshow(image)

Polarization mode

By default, the direction of the vector field affects the result. That is, the sign of each component matters. Such a vector field is analogous to a velocity field. However, the sign of u or v may sometimes be irrelevant, and only their absolute directions should be taken into account. Such a vector field is analogous to a polarization field. rLIC supports this use case via an additional keyword argument, uv_mode, which can be either 'velocity' (default), or 'polarization'. In practice, the difference between these two modes in only visible around sharps changes in sign in either u or v, and with certain kernels. Let's illustrate one such case

import matplotlib.pyplot as plt
import numpy as np

import rlic

SHAPE = NX, NY = (256, 256)
prng = np.random.default_rng(0)

texture = prng.random(SHAPE)
kernel = 1 - np.abs(np.linspace(-1, 1, 65, dtype="float64"))

U0 = np.ones(SHAPE)
ii = np.broadcast_to(np.arange(NX), SHAPE)
U = np.where(ii < NX / 2, -U0, U0)
V = np.zeros((NX, NX))

fig, axs = plt.subplots(ncols=3, sharex=True, sharey=True, figsize=(15, 5))
for ax in axs:
    ax.set(aspect="equal", xticks=[], yticks=[])

ax = axs[0]
ax.set_title("Input vector field")
Y, X = np.mgrid[0:NY, 0:NX]
ax.streamplot(X, Y, U, V)

for uv_mode, ax in zip(("velocity", "polarization"), axs[1:], strict=True):
    image = rlic.convolve(
        texture,
        U,
        V,
        kernel=kernel,
        uv_mode=uv_mode,
        boundaries={"x": "periodic", "y": "closed"},
    )
    ax.set_title(f"{uv_mode=!r}")
    ax.imshow(image)

Memory Usage

rLIC.convolve allocates exactly two buffers with the same size as texture, u and v, regardless of the number of iterations performed, one of which is discarded when the function returns. This means that peak usage is about 5/3 of the amount needed to hold input data in memory, and usage drops to 4/3 on return.

Metadata

Release files for rlic 0.5.4

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

Source distribution (sdist)

Source distribution for rlic 0.5.4
File Size Uploaded
rlic-0.5.4.tar.gz 27.9 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for rlic 0.5.4
File
rlic-0.5.4-cp311-abi3-win_arm64.whl CPython 3.11 abi3 Windows ARM64 Details
rlic-0.5.4-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details
rlic-0.5.4-cp311-abi3-musllinux_1_2_x86_64.whl CPython 3.11 abi3 Linux musl 1.2+ x86-64 Details
rlic-0.5.4-cp311-abi3-musllinux_1_2_aarch64.whl CPython 3.11 abi3 Linux musl 1.2+ ARM64 Details
rlic-0.5.4-cp311-abi3-manylinux_2_28_x86_64.whl CPython 3.11 abi3 Linux glibc 2.28+ x86-64 Details
rlic-0.5.4-cp311-abi3-manylinux_2_28_aarch64.whl CPython 3.11 abi3 Linux glibc 2.28+ ARM64 Details
rlic-0.5.4-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details
rlic-0.5.4-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details

Total release size: 2.0 MB

Release files / rlic-0.5.4.tar.gz

Download URL rlic-0.5.4.tar.gz
Size 27.9 kB
Tags Source
SHA-256 checksum
How to use checksums
8445147f3eeab6eeb30237946992fb8e644c03deb15210d5b59aa1342b81aa6e
BLAKE2b-256 checksum
How to use checksums
adad05de413aa63a6789332f8e169a16ed1a26a540bbcb68a1684f5a84cbc27d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 7, 2026.

Transparency log

Release files / rlic-0.5.4-cp311-abi3-win_arm64.whl

Download URL rlic-0.5.4-cp311-abi3-win_arm64.whl
Size 127.6 kB
Tags CPython 3.11 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
0c3336f3af7192fa0605c8ab4263a79e87776d825fb034cf8ce3f71413e4c628
BLAKE2b-256 checksum
How to use checksums
4ba8cad60dd255fa4c54578421d6a715e1f4c1f1e7f001c723d50becb53c5703
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 7, 2026.

Transparency log

Release files / rlic-0.5.4-cp311-abi3-win_amd64.whl

Download URL rlic-0.5.4-cp311-abi3-win_amd64.whl
Size 139.1 kB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
467b7006d8da8e636801ba1aa61448484f017fc233d9a8b129050e61792be1b5
BLAKE2b-256 checksum
How to use checksums
02c9736e4a334fc5c238d6c0c4b50fd04df04d4ac307f50251efeab5223a7bc1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 7, 2026.

Transparency log

Release files / rlic-0.5.4-cp311-abi3-musllinux_1_2_x86_64.whl

Download URL rlic-0.5.4-cp311-abi3-musllinux_1_2_x86_64.whl
Size 454.0 kB
Tags CPython 3.11 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
a795e86670a19e551cc0a81a749bb46eb64232a1ae8f89925029f0d132ae4783
BLAKE2b-256 checksum
How to use checksums
1646acaa783b49457677e25e0079cfb2b1a62a22dbe043beee92f029d15d365e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 7, 2026.

Transparency log

Release files / rlic-0.5.4-cp311-abi3-musllinux_1_2_aarch64.whl

Download URL rlic-0.5.4-cp311-abi3-musllinux_1_2_aarch64.whl
Size 403.3 kB
Tags CPython 3.11 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
35ffbe5324a01cfba85d75ad180d58b264a384a5fb7d747d0432552ee6f1c4c5
BLAKE2b-256 checksum
How to use checksums
62dd6299a3df8e14c1fe2407a7a4e13fa35253c6c3100b28fd05182c0c16b928
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 7, 2026.

Transparency log

Release files / rlic-0.5.4-cp311-abi3-manylinux_2_28_x86_64.whl

Download URL rlic-0.5.4-cp311-abi3-manylinux_2_28_x86_64.whl
Size 242.0 kB
Tags CPython 3.11 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
53e73aad38a2852ef672668a0eda23d9a6e6ca866c60fdb1c23d46e68cdc182f
BLAKE2b-256 checksum
How to use checksums
31e6811de3a6eeb2f0b94de0ed365a0bd5d2fdd47599ff8e0b30752f35621609
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 7, 2026.

Transparency log

Release files / rlic-0.5.4-cp311-abi3-manylinux_2_28_aarch64.whl

Download URL rlic-0.5.4-cp311-abi3-manylinux_2_28_aarch64.whl
Size 225.6 kB
Tags CPython 3.11 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
1ec320095eae236b7cfac5edf70bc6cfbf573bd287f6813d4ee367f3f4b4b101
BLAKE2b-256 checksum
How to use checksums
a012b7190253af8b00f2ddd9cc3e1dbe9d2f6c19abc7e81eb965aa805fc25f72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 7, 2026.

Transparency log

Release files / rlic-0.5.4-cp311-abi3-macosx_11_0_arm64.whl

Download URL rlic-0.5.4-cp311-abi3-macosx_11_0_arm64.whl
Size 205.7 kB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ee73866d8dfa12124fceda8285b58d97d6fdf1f26302db44ab3a5f2270712409
BLAKE2b-256 checksum
How to use checksums
f59f97dab553a3044f0eed84917912bb4267803e87f10d2f76895ceb297994d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 7, 2026.

Transparency log

Release files / rlic-0.5.4-cp311-abi3-macosx_10_12_x86_64.whl

Download URL rlic-0.5.4-cp311-abi3-macosx_10_12_x86_64.whl
Size 218.2 kB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
dfe73647d62c381f683a36a589f9b641ce7466ac83cbd58e147c02e4333c04aa
BLAKE2b-256 checksum
How to use checksums
91c37362eea9114d207f411fe6b746ef2bd0aa58b69bd0c7c434c7de50c5d089
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 7, 2026.

Transparency log

Release history Release notifications | RSS feed

0.5.6

17 release files

0.5.5

9 release files

This release

0.5.4 This release

9 release files

0.5.3

10 release files

0.5.2

10 release files

0.5.1

9 release files

0.5.0

9 release files

0.4.0

9 release files

0.3.4

9 release files

0.3.3

9 release files

0.3.2

9 release files

0.3.1

9 release files

0.3.0

9 release files

0.2.2

9 release files

0.2.1

9 release files

0.2.0

9 release files

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

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