Skip to main content

pc2img

pc2img is a scientific Python library from the ETH Zurich Geosensors and Engineering Geodesy (GSEG) group that converts 3D point clouds into 2D raster images. It projects points into image space (spherical, orthographic, or perspective), interpolates the scattered values onto a pixel grid, and computes named “features” (range, scalar fields, gradients, hillshade, RRIM, multiscale gradient, and more) as rasters, held in a lazy disk-backed cache. A tiled orchestrator fans the same pipeline across many point-cloud tiles in parallel.

Installation

Install the latest release from PyPI:

pip install pc2img

This installs pc2img together with its two core dependencies, pchandler (point-cloud data and geometry) and GSEGUtils (the lazy disk-cache layer), both pulled from PyPI. pc2img requires Python 3.12.

Optional extras

  • pc2img[viz] installs matplotlib, used only for colormap support in convert_to_image. Without it, colormap conversion raises a clear error; everything else works unaffected.

  • pc2img[cuda12] / pc2img[cuda11] pull the GPU-accelerated RAPIDS stack through pchandler. The two extras are mutually exclusive — pick the one that matches your NVIDIA driver. Run nvidia-smi and read the “CUDA Version” in the top-right corner: driver support for CUDA >= 12.0 means pc2img[cuda12] (preferred), an older driver capped at CUDA 11.x means pc2img[cuda11]. Both extras need the NVIDIA package index:

    pip install pc2img[cuda12] --extra-index-url=https://pypi.nvidia.com
  • pc2img[rrim] is a signposting-only extra: it installs no additional packages. See the RRIM notice below for what actually enables the feature.

Quickstart

The example below builds a synthetic point cloud, runs it through the spherical projection + Delaunay interpolation pipeline, and computes the range raster:

import numpy as np
from GSEGUtils.lazy_disk_cache import LazyDiskCacheConfig
from pchandler import PointCloudData

from pc2img.core import PointCloudImageGenerator
from pc2img.strategies import DelaunayInterpolation, SphericalProjection
from pc2img.util import convert_to_image

# An (N, 3) array of xyz points; r / spherical coords / field of view
# are all derived from xyz.
xyz = np.random.default_rng(0).normal(size=(5000, 3)) + [0, 0, 10]
pcd = PointCloudData(xyz=xyz)

cache_config = LazyDiskCacheConfig(cache_path="./cache", enable_caching=True)

generator = PointCloudImageGenerator(
    pcd,
    img_res=(512, 512),
    proj=SphericalProjection(field_of_view=pcd.fov),
    interp=DelaunayInterpolation(),
    lazy_disk_cache_config=cache_config,
)
rasters = generator.generate(features=["range"])

range_raster = rasters["range"]           # a raw float raster
range_uint8 = convert_to_image(range_raster, normalize=True)  # uint8 export

PointCloudImageGenerator takes the point cloud, the target image resolution, a projection strategy, an interpolation strategy, and an optional cache configuration; generate() accepts a list of feature names and returns a dict mapping each name to its raster.

Feature overview

Feature rasters are requested by name; the name itself is a small DSL that also parameterizes the computation. A selection of the registered feature families:

  • range — the per-point range (distance from sensor), interpolated onto the grid.

  • scalar_field_<name> — any scalar field carried on the point cloud, interpolated onto the grid.

  • gradient_<axis>_<base_feature>[_px<pixel_size>] — the gradient of a base feature raster along x or y, e.g. gradient_x_range.

  • hillshade[_<base_feature>][_<azimuth>][_<altitude>][_<z_factor>] — Lambertian hillshade illumination of a base raster.

  • normalized_<base_feature>[_<low>_<high>] and clip_<base_feature>_<low>_<high> — percentile normalization/clipping of a base raster.

  • multigrad_<base_feature>_<sigma1>-<sigma2>-... — scale-normalized gradients at multiple Gaussian scales.

  • rrim, rrim_pack_(...), rrim_component_(...) — the RRIM (Red Relief Image Map style) feature family; see the notice below.

Each feature strategy documents its full name grammar in its class docstring — see src/pc2img/features/base_features.py, derivative_features.py, and rrim.py.

RRIM notice

The RRIM feature is an independent, image-space implementation of the red-relief-image visualization technique, built on the patent-expiry basis recorded in NOTICE: the core patent family covering the technique has expired in every jurisdiction in which it was granted. The technique is credited to Tatsuro Chiba and Asia Air Survey Co., Ltd., with the openness brightness component credited to the independent academic method of Yokoyama, Shirasawa, and Pike (2002). “RRIM” and “Red Relief Image Map” may be trademarks of Asia Air Survey Co., Ltd.; pc2img is not affiliated with or endorsed by Asia Air Survey Co., Ltd.

The RRIM feature is opt-in: it registers only after an explicit import pc2img.features.rrim — it is not part of the default pc2img.features barrel, and installing the pc2img[rrim] extra alone does not register it. See NOTICE and docs/ip/ for the full intellectual-property basis.

Documentation and contributing

Full documentation is hosted at https://pc2img.readthedocs.io/en/latest/. Development setup, environment bootstrap, and test-running instructions are in CONTRIBUTING.md. See the changelog for release history.

pc2img is licensed under the BSD 3-Clause License.

Metadata

Release files for pc2img 0.11.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 pc2img 0.11.0
File Size Uploaded
pc2img-0.11.0.tar.gz 271.2 kB Details

Built distribution (wheel)

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

Total release size: 338.3 kB

Release files / pc2img-0.11.0.tar.gz

Download URL pc2img-0.11.0.tar.gz
Size 271.2 kB
Tags Source
SHA-256 checksum
How to use checksums
310ac5b66702f92b5e1c79da374974df60ef2f9c5511876cbd7ff138561c1e9f
BLAKE2b-256 checksum
How to use checksums
3eec8f053a4a13328c706e09317078361317e7374283304f0beb01176f6c5845
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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

Transparency log

Release files / pc2img-0.11.0-py3-none-any.whl

Download URL pc2img-0.11.0-py3-none-any.whl
Size 67.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9a1b36c682f8e3415dfe7954318fc403a0863616da3cf3ca8a12032e55b22101
BLAKE2b-256 checksum
How to use checksums
b7947e693ea1d5423222e23170696e2d01aa15157da01466351dbecd040bf0d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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

Transparency log

Release history Release notifications | RSS feed

This release

0.11.0 This release

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