File size: 916 Bytes
10e4cb6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import streamlit as st
import base64

# Function to set a background image
def set_background(image_path):
    with open(image_path, "rb") as file:
        encoded_image = base64.b64encode(file.read()).decode()
    st.markdown(
        f"""
        <style>
        .stApp {{
            background-image: url("data:image/png;base64,{encoded_image}");
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
        }}
        </style>
        """,
        unsafe_allow_html=True
    )

# Streamlit App
st.title("Word Cloud Application")
st.write("This application displays a word cloud with a custom background.")

# Set background image
# Use either 1.png or 2.png as needed
set_background("1.png")  # Replace with the correct image path (e.g., "2.png")

st.header("Word Clouds Display")
st.write("Use the images in your layout or add functionality.")