Image for portable files: html base 64 format convert

 R

 

 

Python

import base64

# Path to your image file
image_path = "path/to/your/sb_logo_boletin_v1.PNG"

# Read the image file in binary mode
with open(image_path, "rb") as image_file:
    # Encode the image to Base64
    base64_string = base64.b64encode(image_file.read()).decode('utf-8')

 

 


<img src= f"data:image/png;base64,{base64_string}" alt="Static Image" width="420" height="65" style="color:#FFFFFF; margin:0; padding:0;">

Entradas populares

SQL