File size: 443 Bytes
a941c51 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
import base64
from PIL import Image
from io import BytesIO
def visualize_base64_image(base64_string:str):
"""
Visualize a base64-encoded image string.
Args:
base64_string: The base64-encoded image string.
"""
# Decode the base64 string back to binary
image_data = base64.b64decode(base64_string)
# Create an image from the binary data
img = Image.open(BytesIO(image_data))
img.show() |