Skip to main content

JAX image interpolation utilities

Project description

im_jax

Image interpolation utilities in JAX, focused on bicubic interpolation with predictable behavior at boundaries. This is a pure JAX implementation comparable to jax.scipy.ndimage.map_coordinates(..., order=3). Linear interpolation is already available in dm_pix; this repository focuses on bicubic interpolation.

Bicubic interpolation

Bicubic interpolation estimates pixel values from a 4x4 neighborhood, producing smoother results than bilinear methods while preserving local gradients. This implementation is designed for batched, JAX-native workloads and keeps shapes and dtypes stable across jit, vmap, and grad.

Installation

pip install im_jax

For development:

pip install -e ".[dev]"

Usage

import jax.numpy as jnp
from im_jax import flat_nd_cubic_interpolate

image = jnp.arange(12.0, dtype=jnp.float32).reshape(3, 4)
locations = jnp.array([[0.5, 1.25], [1.0, 2.5]], dtype=jnp.float32)
values = flat_nd_cubic_interpolate(image, locations)

Benchmarks and validation

See docs/interpolation_benchmarks.ipynb for accuracy checks, validation against reference results, and runtime measurements.

Tests

pytest

Release / PyPI

This project is published to PyPI automatically from GitHub tags.

  • Create a tag like v0.1.0 and push it.
  • GitHub Actions builds and publishes the release to PyPI.

License

GPL-3.0-only. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

im_jax-0.1.1.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

im_jax-0.1.1-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file im_jax-0.1.1.tar.gz.

File metadata

  • Download URL: im_jax-0.1.1.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for im_jax-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0f2f64bbdc2fe68634852821c80a02fb0c6a47b37c6f74a220aa03601d5eb801
MD5 725cc00773503d2b1cf844a654b057ca
BLAKE2b-256 75ad99e43e664d65e3f702420bb65bf666ce04ae05281e307b5d7d21ac4181f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for im_jax-0.1.1.tar.gz:

Publisher: publish-pypi.yml on EmileRouxSMB/im_jax

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file im_jax-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: im_jax-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for im_jax-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7deb709c13bb372bf5e6fcb7c7fff97c067b5ae66f9a0d4046f84ff37abd0626
MD5 c380578c502e1165f0300e0684d29d46
BLAKE2b-256 76fa8ec8f230b14a5922847cf04f75dddb5b0043da00d9f64210f5d12b0d830d

See more details on using hashes here.

Provenance

The following attestation bundles were made for im_jax-0.1.1-py3-none-any.whl:

Publisher: publish-pypi.yml on EmileRouxSMB/im_jax

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page