-
Notifications
You must be signed in to change notification settings - Fork 20
Configurable Outline Thickness for Drawing Shapes #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hello sumn2u, I would like to help with this issue. |
Hey Sumn2u, I reviewed the flask section of the code and updated the draw.foo() functions with a config variable, but as the only draw.foo functions are in the download routes, the width change is only reflected in the downloaded images and not in the preview. Is this what you were looking for, or should I update the frontend/js parts of the code base too? Another issue: when the line thickness is set to a large number (I used 30 instead of the default of 3 in the picture above), the corners are very visibly jagged. You might wish to consider implementing logic for rounding out the ends of the lines to fix this issue. This issue is definitely less noticeable on thinner outline values (as in the preview picture). Also with regards to the README file, there is currently no mention of modifying the config.py file for the MASK_BACKGROUND_COLOR variable either, so should I add a new section to detail how a user can optionally customize these variables? I've also noticed several other config variables that were defined in the main app.py file instead of in the config.py file. Would you like to migrate these variables all to the config file? Lastly, I noticed that the current flask code uses the deprecated (and now redundant) flask jsonify method. Would you like to update the code to remove the "jsonify()"s ? |
@DQ4443 Thanks for providing the detailed information. I was not aware of the thickness issue with large numbers. Ideally, it would be nice to have a slider in the UI to control the thickness. Based on its value, the Flask application will adjust accordingly and reflect the changes in the downloaded file. For now, we can use the config variable value and apply it in the Flask application. As for the UI, we can create a separate task to add a slider, limiting the upper bound to 5 to mitigate the thickness issue. This slider will then be linked to the Flask application.
I have added the customization instructions in the documentation section documentation section and will include more information once it's completed.
It would be great if you could move them to the config file. I suggest creating an issue for this task and then assigning it to yourself if you are working on it.
Sure. Thanks for providing the feedback. I suggest creating separate issues and assigning yourself to the ones you want to work on. |
The current outline width used in the UI is defined in RegionShapes. Here, you can see that based on the tools, we have various |
Cool I'll just implement the config variable in the backend first and create a separate PR for the frontend.
Would you like me to add a section in README file to direct users to the documentation?
I'll create separate PRs for these two issues |
That would be great. |
During masking, we have set the outline thickness using
width
to only one region and it's hard coded.Introduce a configuration parameter (
OUTLINE_THICKNESS
) to control the thickness of outlines for shapes drawn usingdraw.polygon
anddraw.rectangle
, and also update thedraw.ellipse
width value with this.Benefits
Implementation Plan
OUTLINE_THICKNESS
parameter to configuration settings.README.md
.Acceptance Criteria
OUTLINE_THICKNESS
.The text was updated successfully, but these errors were encountered: