diff --git a/src/TeamsISO.App/Assets/_recolor_dragon.py b/src/TeamsISO.App/Assets/_recolor_dragon.py new file mode 100644 index 0000000..2ce5caf --- /dev/null +++ b/src/TeamsISO.App/Assets/_recolor_dragon.py @@ -0,0 +1,34 @@ +from PIL import Image +import os + +# We treat the navy-blue dragon-mark.png as a silhouette source: anything with +# nontrivial alpha is "dragon", everything else stays transparent. We emit a +# pure-black and pure-white variant, tightly cropped to the actual content +# bbox so they center cleanly when used as a watermark. +ROOT = os.path.dirname(os.path.abspath(__file__)) +src_path = os.path.join(ROOT, "dragon-mark.png") +src = Image.open(src_path).convert("RGBA") + +alpha = src.split()[-1] +# Threshold to drop anti-alias fringe that can fool getbbox into reporting +# the whole canvas as "in". +mask = alpha.point(lambda v: 255 if v > 16 else 0) +bbox = mask.getbbox() +print("content bbox =", bbox, "size =", (bbox[2] - bbox[0], bbox[3] - bbox[1])) + +cropped = src.crop(bbox) +_, _, _, ca = cropped.split() + +for name, rgb in (("black", (0, 0, 0)), ("white", (255, 255, 255))): + flat = Image.merge( + "RGBA", + ( + Image.new("L", cropped.size, rgb[0]), + Image.new("L", cropped.size, rgb[1]), + Image.new("L", cropped.size, rgb[2]), + ca, + ), + ) + out_path = os.path.join(ROOT, f"dragon-mark-{name}.png") + flat.save(out_path, "PNG", optimize=True) + print("wrote", out_path, flat.size) diff --git a/src/TeamsISO.App/Assets/dragon-mark-black.png b/src/TeamsISO.App/Assets/dragon-mark-black.png new file mode 100644 index 0000000..c856193 Binary files /dev/null and b/src/TeamsISO.App/Assets/dragon-mark-black.png differ diff --git a/src/TeamsISO.App/Assets/dragon-mark-white.png b/src/TeamsISO.App/Assets/dragon-mark-white.png new file mode 100644 index 0000000..f374b81 Binary files /dev/null and b/src/TeamsISO.App/Assets/dragon-mark-white.png differ diff --git a/src/TeamsISO.App/MainWindow.xaml b/src/TeamsISO.App/MainWindow.xaml index 594dc87..a23a5ff 100644 --- a/src/TeamsISO.App/MainWindow.xaml +++ b/src/TeamsISO.App/MainWindow.xaml @@ -106,7 +106,11 @@ BorderThickness="0" Cursor="Hand" ToolTip="About TeamsISO"> - + @@ -447,8 +451,30 @@ BorderBrush="{DynamicResource Wd.Border}" BorderThickness="1" CornerRadius="{StaticResource Radius.M}" - Background="{DynamicResource Wd.Surface}"> + Background="{DynamicResource Wd.Surface}" + ClipToBounds="True"> + + + + + + + diff --git a/src/TeamsISO.App/Themes/Theme.Light.xaml b/src/TeamsISO.App/Themes/Theme.Light.xaml index f1e64bc..90c774b 100644 --- a/src/TeamsISO.App/Themes/Theme.Light.xaml +++ b/src/TeamsISO.App/Themes/Theme.Light.xaml @@ -46,4 +46,15 @@ + + +