Replicate the app from the image.
To upload files, please first save the app
import streamlit as st
from streamlit_drawable_canvas import st_canvas
import numpy as np
st.title("Simple Drawing Canvas")
# Create a canvas component
canvas_result = st_canvas(
stroke_width=2,
stroke_color="#000000",
background_color="#ffffff",
background_image=None,
height=400,
width=600,
drawing_mode="freedraw",
key="canvas",
)
# Display the canvas grid with guidelines
if canvas_result.image_data is not None:
# The image data will update in real-time as you draw
pass
Hi! I can help you with any questions about Streamlit and Python. What would you like to know?