Skip to main content

Compact serialization of NumPy uint8 arrays via WebP + base64

Project description

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

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

imstr-0.1.3.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

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

imstr-0.1.3-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

Details for the file imstr-0.1.3.tar.gz.

File metadata

  • Download URL: imstr-0.1.3.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for imstr-0.1.3.tar.gz
Algorithm Hash digest
SHA256 c1c390655c9a5e5a627e6692a717f78311c3f80d75d8a57cabd68b8cbff304f2
MD5 069176def08b5d8c1347fd94139b8d58
BLAKE2b-256 9d824a7e272bbf31aa4d3e42cfa493d4ac14fc383848589d1512d947e2d05138

See more details on using hashes here.

File details

Details for the file imstr-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: imstr-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 2.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for imstr-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 59c7393542c1cb882726cfff9ad223e0f5f43126ce9bb2f8c8ece24888b85996
MD5 204bc4dd745fd67d85e80a514bbd6cc8
BLAKE2b-256 60e791e85e80c726ecd53b34c01bd7924d35f579f247325b9becf5ddd762f5b0

See more details on using hashes here.

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