--- id: pylerc version: "4.2.0" license: Apache 2 license_treatment: permissive maintenance: active --- # pylerc — Limited Error Raster Compression License: permissive · Maintenance: active · Downloads: 173.0K/mo ## What it is and what it does pylerc is a Python binding for LERC, an open-source raster compression format designed for rapid encoding and decoding of image tiles with user-controlled maximum compression error. It works with numpy arrays in 2D, 3D, or 4D shapes, supporting any pixel type from byte to double, and allows marking pixels as invalid via masks, noData values, or NaN. The package offers two main APIs: one using numpy masked arrays (encode_ma/decode_ma) and another using separate data and mask arrays (encode_4D/decode_4D), giving flexibility depending on whether all pixels are valid or sparse masking is needed. Version 4.2.0 introduces stricter size limits for safety: input data is capped at 2 GB per band, compressed output at 2 GB per band, and total blob size at 4 GB across all bands. The package maintains backward compatibility with LERC 3.0 functions, though mixed valid/invalid cases at the same pixel for multi-band data require the newer API. It is actively maintained, supports current Python versions (3.11–3.14), and carries no known security vulnerabilities. Use it for: - Compress geospatial satellite or aerial imagery tiles for efficient storage and transmission with bounded error. - Encode scientific raster data (e.g., elevation models, climate grids) where lossy compression with user-defined error tolerance is acceptable. - Decode LERC-compressed blobs received from remote APIs or read from disk into numpy arrays for analysis. - Handle multi-band imagery (e.g., RGB, hyperspectral) with per-band noData values and mixed valid/invalid pixels. - Benchmark or migrate existing LERC 3.0 workflows to the newer masked-array API for cleaner mask handling. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. pylerc encodes and decodes raster image data using the LERC (Limited Error Raster Compression) format, supporting lossless and lossy compression with user-defined maximum error per pixel. Yes. pylerc is actively maintained, carries no known vulnerabilities, uses a permissive Apache 2 license, and offers a clean numpy-integrated API for a specialized but well-defined task. Install it if you work with raster imagery and need bounded-error compression; the medium install friction is typical for packages with compiled wheels. Not necessary for general image compression or if your raster format is already standardized in your pipeline. ## Install pip install pylerc uv add pylerc poetry add pylerc ## Installing pylerc Before you install: Active maintenance with a recent release (22 days old). Medium install friction due to platform-specific wheels; numpy is the sole runtime dependency. Supports Python 3.11 through 3.14. License in practice: Apache 2 permissive license allows commercial and private use with minimal restrictions; suitable for most projects. Quickstart: import pylerc import numpy as np # Encode a masked array with max error of 0.1 data = np.ma.array([[1, 2], [3, 4]], mask=[[False, False], [False, True]]) result, n_bytes, blob = pylerc.encode_ma(data, nDepth=1, maxZErr=0.1, nBytesHint=0) # Decode back result, decoded_arr, depth, nodata = pylerc.decode_ma(blob) Requires Python 3.11 or later; numpy must be installed. Verify before relying: - Whether the 2 GB per-band input and output limits in version 4.2.0 are sufficient for typical use cases. - Performance characteristics (encoding/decoding speed, compression ratios) compared to other raster formats. - Compatibility with existing LERC 3.0 blobs and migration path for legacy data. ## Package facts - License: Apache 2 (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 173.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags raster compression encoding decoding, lerc image compression, geospatial raster format, lossy lossless image compression, numpy array compression, limited error raster codec, raster-compression, geospatial, numpy-integration [View on SkillFed](https://skillfed.io/packages/pylerc) · [View on PyPI](https://pypi.org/project/pylerc/)