Skip to content

Commit

Permalink
Update watermark options for updated drawtext filter
Browse files Browse the repository at this point in the history
The line_h is calculated differently, use text_h instead.
Alignment also updated to align on baseline for easiest alignment.
  • Loading branch information
153957 committed Apr 6, 2024
1 parent c74e04a commit 9041089
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions time_lapse/watermark.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
'fontfile': JOST_FONT,
'fontcolor': 'white',
'shadowcolor': 'black',
'x': 'main_w-text_w-line_h',
'x': 'main_w - text_w - text_h',
'y_align': 'baseline',
}


Expand All @@ -20,12 +21,12 @@ def add_watermark(
watermarked_input = input_node.drawtext(
text=text,
fontsize=fontsize,
y='main_h-3*line_h',
y='main_h - (text_h * 2)',
**FONT_OPTIONS,
).drawtext(
text=subtext,
fontsize=int(fontsize * 0.625),
y='main_h-2*line_h',
y='main_h - text_h',
**FONT_OPTIONS,
)
return watermarked_input

0 comments on commit 9041089

Please sign in to comment.