Skip to main content

Library for converting RGB / Grayscale numpy images from to base64 and back.

Installation

pip install -U image_to_base_64

Conversion

Takes numpy.array or PIL.Image as input

RGB to base 64

base64 = rgb2base64(rgb_image, image_format)

where image format is JPEG, PNG

Grayscale to base 64

base64 = grayscale2base64(grayscale_image)

Base64 to RGB image

output_type = "cv2" # or "PIL"
rgb_image = base64_to_rgb(base64, output_type)

Base64 to Grayscale image

output_type = "cv2" # or "PIL"
grayscale_image = base64_to_grayscale(base64, output_type)

Issues

For some reason I cannot convert RGB image to JPEG representation in base 64 and back without losses. => test only for PNG and not JPEG

Metadata

Release files for image2base64 0.0.5

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

Source distribution (sdist)

Source distribution for image2base64 0.0.5
File Size Uploaded Provenance Actions
image2base64-0.0.5.tar.gz 7.6 kB Without provenance Details for image2base64-0.0.5.tar.gz

Release files / image2base64-0.0.5.tar.gz

Download URL image2base64-0.0.5.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1e93b792572f5849403b8f2e4075f0a8156ce9beaaec42dd5579bf9562ff0454
BLAKE2b-256 checksum
How to use checksums
c50c39a6b56ce0092f2ccdde155ce6519b758071254a53561f1f60ad5b137a7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.8.2 requests/2.23.0 setuptools/63.4.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.7.3

Security for image2base64 0.0.5

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