Update app.py
Browse files
app.py
CHANGED
@@ -47,8 +47,11 @@ with col2:
|
|
47 |
# Process uploaded image or drawing
|
48 |
if file is not None:
|
49 |
image = Image.open(file) # Read image with PIL library
|
50 |
-
|
51 |
-
|
|
|
|
|
|
|
52 |
else:
|
53 |
st.write("Please upload an image or use the canvas to draw.")
|
54 |
image = None
|
|
|
47 |
# Process uploaded image or drawing
|
48 |
if file is not None:
|
49 |
image = Image.open(file) # Read image with PIL library
|
50 |
+
if canvas_result.image_data is not None:
|
51 |
+
temp_image = Image.fromarray(canvas_result.image_data.astype('uint8'), 'RGBA').convert('RGB')
|
52 |
+
temp_image.save("temp_canvas_image.jpg")
|
53 |
+
st.image(temp_image) # Display to confirm
|
54 |
+
image = temp_image
|
55 |
else:
|
56 |
st.write("Please upload an image or use the canvas to draw.")
|
57 |
image = None
|