andfanilo / streamlit-drawable-canvas

Do you like Quick, Draw? Well what if you could train/predict doodles drawn inside Streamlit? Also draws lines, circles and boxes over background images for annotation.
https://drawable-canvas.streamlit.app/
MIT License
541 stars 83 forks source link

allow canvas larger than background_image #103

Open ghost opened 1 year ago

ghost commented 1 year ago

For making rectangle masks, it would be nice to have the canvas be slightly larger than the image, aka with 20-40 pixels of padding so that users can draw rectangles without touching the edge and the rectangle getting killed as its registered as a declick.

Current workaround: add padding to the image, then give it to st_canvas and then de-pad before sending it to the functions.