Mattral commited on
Commit
766dd81
·
verified ·
1 Parent(s): e763c41

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
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
- elif canvas_result.image_data is not None:
51
- image = Image.fromarray(canvas_result.image_data.astype('uint8'), 'RGBA').convert('RGB')
 
 
 
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