Skip to main content

Base64 Image Handler for Data URIs

Project description

PyPi

Base64-encoded images for HTML data URIs.

pip install base64image

Examples

``` from base64image import Base64Image b64_image = Base64Image.from_file(“wowo.png”) image_element = ‘’ % base64_image

base64_image = Base64Image.from_url(”http://example.org/haha.jpg”) base64_image.to_file(“haha.jpg”)

base64_image.image_format base64_image.base64_image_string base64_image.image_string

try: base64_image = Base64Image.from_base64_image_string(”…”) except ValueError: print(“lol that string isn’t an image encoded in base64…”) else: pil_image = base64_image.get_pil_image() ``

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

base64image-0.4.0.tar.gz (2.6 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page