-
Notifications
You must be signed in to change notification settings - Fork 1
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
fill color customization #6
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting work! some changes requested
line_color=(144, 70, 180, 255), embedded_color=True) | ||
fsw = "M530x518S19a30500x482S19a38465x481S22f04509x506S22f14467x504" | ||
image = signwriting_to_image(fsw, line_color=( | ||
10, 23, 122, 255), fill_color=(255, 255, 255, 0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't like where the line breaks - either new line before line_color
or same line with the color
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stupid formatter
signwriting/visualizer/visualize.py
Outdated
line_color: tuple[int, int , int, int]=(0, 0, 0, 255), embedded_color=False) -> Image: | ||
# pylint: disable=too-many-locals, too-many-arguments | ||
def signwriting_to_image(fsw: str, antialiasing=True, trust_box=True, embedded_color=False, | ||
line_color: Tuple[int, int, int, int] = (0, 0, 0, 255), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps it is worth, for readability:
type RGBA = Tuple[int, int, int, int]
signwriting/visualizer/visualize.py
Outdated
@@ -53,7 +55,7 @@ def signwriting_to_image(fsw: str, antialiasing=True, trust_box=True, | |||
x, y = symbol["position"] | |||
x, y = x - min_x, y - min_y | |||
symbol_id = key2id(symbol["symbol"]) | |||
draw.text((x, y), symbol_fill(symbol_id), (255, 255, 255, 255), fill_font) | |||
draw.text((x, y), symbol_fill(symbol_id), fill_color, fill_font, embedded_color=embedded_color) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we name these variables? fill=fill_color, font=fill_font
@@ -55,10 +54,9 @@ def test_image_small_box_is_corrected(self): | |||
assert_array_equal(np.array(image), np.array(reference_image)) | |||
|
|||
def test_image_with_line_and_embedded_color(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test is now problematic as it tests too many things at once: line color, and transparent fill.
the name suggests it tests embedded_color
but it doesn't
needs at least three tests:
- embedded_color
- line_color
- fill_color
- ideally, line and fill
- ideally, line and embedded
Its done. |
No description provided.