Skip to main content

imstr

Compact serialization of NumPy uint8 arrays via WebP lossless compression + base64 encoding.

imstr converts 2D grayscale and 3D RGB/RGBA uint8 arrays into plain strings that can be stored or sent through text-only formats, then restores them without loss.

Installation

pip install imstr

Usage

import numpy as np
from imstr import encode, decode

arr = np.random.randint(0, 256, (100, 100, 3), dtype=np.uint8)
encoded = encode(arr)
decoded = decode(encoded)

assert np.array_equal(arr, decoded)

Supported Arrays

  • dtype: np.uint8
  • shape: (height, width) grayscale, (height, width, 3) RGB, or (height, width, 4) RGBA

Development

pip install -e ".[test]"
pytest

Metadata

Release files for imstr 0.1.3

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

Source distribution (sdist)

Source distribution for imstr 0.1.3
File Size Uploaded Provenance Actions
imstr-0.1.3.tar.gz 2.6 kB Without provenance Details for imstr-0.1.3.tar.gz

Built distribution (wheel)

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

Total release size: 5.2 kB

Release files / imstr-0.1.3.tar.gz

Download URL imstr-0.1.3.tar.gz
Size 2.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c1c390655c9a5e5a627e6692a717f78311c3f80d75d8a57cabd68b8cbff304f2
BLAKE2b-256 checksum
How to use checksums
9d824a7e272bbf31aa4d3e42cfa493d4ac14fc383848589d1512d947e2d05138
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / imstr-0.1.3-py3-none-any.whl

Download URL imstr-0.1.3-py3-none-any.whl
Size 2.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
59c7393542c1cb882726cfff9ad223e0f5f43126ce9bb2f8c8ece24888b85996
BLAKE2b-256 checksum
How to use checksums
60e791e85e80c726ecd53b34c01bd7924d35f579f247325b9becf5ddd762f5b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Security for imstr 0.1.3

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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