From f3f96ae6b4815f162aa7b30760485c8f53a03bf2 Mon Sep 17 00:00:00 2001 From: NiemandKG <74151950+NiemandKG@users.noreply.github.com> Date: Tue, 1 Dec 2026 18:13:52 +0600 Subject: [PATCH] Logo: a clean symmetric T, outline redrawn (no remnants of the scythe, G of TOGETHER intact) Co-Authored-By: Claude Opus 5.5 --- Assets/Art/UI/logo_grasscutter.png | 4 +- Docs/Steam/capsules/event_cover_800x450.png | 4 +- Docs/Steam/capsules/event_header_1920x622.png | 4 +- .../Steam/capsules/header_capsule_920x430.png | 4 +- .../capsules/library_capsule_600x900.png | 4 +- .../Steam/capsules/library_header_920x430.png | 4 +- Docs/Steam/capsules/library_logo_1280w.png | 4 +- Docs/Steam/capsules/main_capsule_1232x706.png | 4 +- Docs/Steam/capsules/small_capsule_462x174.png | 4 +- .../capsules/vertical_capsule_748x896.png | 4 +- .../demo/capsules/header_capsule_920x430.png | 4 +- .../demo/capsules/library_capsule_600x900.png | 4 +- .../demo/capsules/library_header_920x430.png | 4 +- .../demo/capsules/library_logo_1280w.png | 4 +- .../demo/capsules/main_capsule_1232x706.png | 4 +- .../demo/capsules/small_capsule_462x174.png | 4 +- .../capsules/vertical_capsule_748x896.png | 4 +- Docs/Steam/source/logo_clean.png | 4 +- Tools/ui/logo_t.py | 151 ++++++++++-------- 19 files changed, 118 insertions(+), 105 deletions(-) diff --git a/Assets/Art/UI/logo_grasscutter.png b/Assets/Art/UI/logo_grasscutter.png index e80e54a..16d412f 100644 --- a/Assets/Art/UI/logo_grasscutter.png +++ b/Assets/Art/UI/logo_grasscutter.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:358a3700142e5b38da6a351e537c63eea27d657032e6ebf8ba86f208c310ff4d -size 866643 +oid sha256:23a675bbda5bb0f6156dabf17c39e9ee8a2dcd7df2c4f6801de309429c1b0456 +size 855991 diff --git a/Docs/Steam/capsules/event_cover_800x450.png b/Docs/Steam/capsules/event_cover_800x450.png index 38a8254..07e6679 100644 --- a/Docs/Steam/capsules/event_cover_800x450.png +++ b/Docs/Steam/capsules/event_cover_800x450.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3894a516331d18e8bca8ab2274993b32eccb0a88209555f24e89baa5cef44504 -size 592508 +oid sha256:30fd315bb5f8576b2264bfb5b95cfdb0787093b05a431a01f0ba60df71f0d973 +size 592103 diff --git a/Docs/Steam/capsules/event_header_1920x622.png b/Docs/Steam/capsules/event_header_1920x622.png index 72a3187..3a61b4d 100644 --- a/Docs/Steam/capsules/event_header_1920x622.png +++ b/Docs/Steam/capsules/event_header_1920x622.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:31dd4c1cbb21f2c3a13033a4c8c1dd266dbc63c755adcfd416db45d277339b56 -size 1898728 +oid sha256:38aab4957222d09e4ed73e2c1f57c8a64c2d763909da42f4056e1ba3c7b1c9d1 +size 1897441 diff --git a/Docs/Steam/capsules/header_capsule_920x430.png b/Docs/Steam/capsules/header_capsule_920x430.png index 486225e..2860f22 100644 --- a/Docs/Steam/capsules/header_capsule_920x430.png +++ b/Docs/Steam/capsules/header_capsule_920x430.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:09682bb1cda12d96a1b00d6d49fa6731e4503cf3b0d34cf27fcb9e231b6e10da -size 673853 +oid sha256:f780b99c62e0bada59b6d6e9cef1c35a6d8168f48d2bf79f2f7238af1c9f2cec +size 673566 diff --git a/Docs/Steam/capsules/library_capsule_600x900.png b/Docs/Steam/capsules/library_capsule_600x900.png index 93ba005..8b4683a 100644 --- a/Docs/Steam/capsules/library_capsule_600x900.png +++ b/Docs/Steam/capsules/library_capsule_600x900.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b1ab9349991782911b180743fa1d7ffa904545bda76c8eb58d169a947781f22e -size 828739 +oid sha256:0a9b001e666abd6567f5efa32c9aa2cbbde86902122bdce5a1eb8ffb2f13a84d +size 828167 diff --git a/Docs/Steam/capsules/library_header_920x430.png b/Docs/Steam/capsules/library_header_920x430.png index 486225e..2860f22 100644 --- a/Docs/Steam/capsules/library_header_920x430.png +++ b/Docs/Steam/capsules/library_header_920x430.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:09682bb1cda12d96a1b00d6d49fa6731e4503cf3b0d34cf27fcb9e231b6e10da -size 673853 +oid sha256:f780b99c62e0bada59b6d6e9cef1c35a6d8168f48d2bf79f2f7238af1c9f2cec +size 673566 diff --git a/Docs/Steam/capsules/library_logo_1280w.png b/Docs/Steam/capsules/library_logo_1280w.png index 5838d7c..fd34d26 100644 --- a/Docs/Steam/capsules/library_logo_1280w.png +++ b/Docs/Steam/capsules/library_logo_1280w.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a4c97ad309e59bcc2cc5e613ed91c85b452031198c17cc03d2ed63a49f6055d7 -size 663630 +oid sha256:d7f971eaaacb9dfe979b2829ddf965017417651ca574e70246d336008f79541b +size 651517 diff --git a/Docs/Steam/capsules/main_capsule_1232x706.png b/Docs/Steam/capsules/main_capsule_1232x706.png index 0601cd7..ab4ea45 100644 --- a/Docs/Steam/capsules/main_capsule_1232x706.png +++ b/Docs/Steam/capsules/main_capsule_1232x706.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fea31f6d3db661546e281c498ad836d3845c18a579f6113aae1f6cd24b9b9d51 -size 1283058 +oid sha256:49998c6e79c11f5c639109f7c39b01daf26db22cec7110461701a229f6dc9087 +size 1282484 diff --git a/Docs/Steam/capsules/small_capsule_462x174.png b/Docs/Steam/capsules/small_capsule_462x174.png index 1f86f9d..7736762 100644 --- a/Docs/Steam/capsules/small_capsule_462x174.png +++ b/Docs/Steam/capsules/small_capsule_462x174.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d5783a1cc33beaa83ee0242621c6c801b776d767284639a6cc9799607158bda6 -size 147376 +oid sha256:796e1e3059decf98df07b21164ffcef5db9678e641dfb739fc57fd460ea84119 +size 147098 diff --git a/Docs/Steam/capsules/vertical_capsule_748x896.png b/Docs/Steam/capsules/vertical_capsule_748x896.png index 377b263..69913bc 100644 --- a/Docs/Steam/capsules/vertical_capsule_748x896.png +++ b/Docs/Steam/capsules/vertical_capsule_748x896.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:df53b15466d573e5b530c1537083353248f53d53e8ad345cec40a324aa51be8a -size 995970 +oid sha256:b743c83381622342f307e32755278e3416a4c39bba92e5372f07a961444bbe68 +size 995205 diff --git a/Docs/Steam/demo/capsules/header_capsule_920x430.png b/Docs/Steam/demo/capsules/header_capsule_920x430.png index b49ace9..4f864b8 100644 --- a/Docs/Steam/demo/capsules/header_capsule_920x430.png +++ b/Docs/Steam/demo/capsules/header_capsule_920x430.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0b83ba88a420a11e4219699f4c7388be4941367bed66cb9cffac8530c2020dda -size 682015 +oid sha256:89fa7877460ebfe36e36a0a4f915ec090a7fd5872c0baea0386d14f6583cc156 +size 681688 diff --git a/Docs/Steam/demo/capsules/library_capsule_600x900.png b/Docs/Steam/demo/capsules/library_capsule_600x900.png index 8253a82..8c85f7c 100644 --- a/Docs/Steam/demo/capsules/library_capsule_600x900.png +++ b/Docs/Steam/demo/capsules/library_capsule_600x900.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:92709e1db756b2a4e726f9245fe7de521016938bcf4b4746938377ccb09f086d -size 837658 +oid sha256:eabfb17396480c593b4924e9235b1674138b594b0aa018b0d6965517846fc796 +size 836939 diff --git a/Docs/Steam/demo/capsules/library_header_920x430.png b/Docs/Steam/demo/capsules/library_header_920x430.png index e89b6e0..a3ad92c 100644 --- a/Docs/Steam/demo/capsules/library_header_920x430.png +++ b/Docs/Steam/demo/capsules/library_header_920x430.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9564d831548cf35e4e8d139b9a5c3ceaa9db9c4b2c5c491d3a0dfc648e57a50f -size 681986 +oid sha256:487f847b2e463ad3f208bad3068c995ceb557e040e12fa2b2da1a5ed3ee977fc +size 681649 diff --git a/Docs/Steam/demo/capsules/library_logo_1280w.png b/Docs/Steam/demo/capsules/library_logo_1280w.png index eaacd5b..7af2c5d 100644 --- a/Docs/Steam/demo/capsules/library_logo_1280w.png +++ b/Docs/Steam/demo/capsules/library_logo_1280w.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9ca28f0640711effce33a865eb35bc91f918656306e6faece21e68eea04da117 -size 718041 +oid sha256:914a4d89a9f8dc9c7e912d54d915ef8cc0d16a1c74deba3d421d05e9d7660395 +size 706231 diff --git a/Docs/Steam/demo/capsules/main_capsule_1232x706.png b/Docs/Steam/demo/capsules/main_capsule_1232x706.png index c191b0a..5dd8946 100644 --- a/Docs/Steam/demo/capsules/main_capsule_1232x706.png +++ b/Docs/Steam/demo/capsules/main_capsule_1232x706.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e9e1167d0bc7767e728b2023ab947c37a73a4f8f3c1434311060d837d9f63e63 -size 1302616 +oid sha256:e5fb37b494d89449d8292a7d3d5264379c71bff9447ccae7a9ccd63b86390677 +size 1301926 diff --git a/Docs/Steam/demo/capsules/small_capsule_462x174.png b/Docs/Steam/demo/capsules/small_capsule_462x174.png index e2ec0be..ea580a2 100644 --- a/Docs/Steam/demo/capsules/small_capsule_462x174.png +++ b/Docs/Steam/demo/capsules/small_capsule_462x174.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a02f740893f0089ac0bd71a72d0bbff1ed1e5b192cc971338af9987add8f9b05 -size 143558 +oid sha256:329ff756fab1c026238d47d4f7b732f58cc7d6c412008f0f40d2ccb59603556a +size 143104 diff --git a/Docs/Steam/demo/capsules/vertical_capsule_748x896.png b/Docs/Steam/demo/capsules/vertical_capsule_748x896.png index fbd2a85..55b08c3 100644 --- a/Docs/Steam/demo/capsules/vertical_capsule_748x896.png +++ b/Docs/Steam/demo/capsules/vertical_capsule_748x896.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d46410f2565c2ad63ed5b17e24fd3bce1b07957c71278eb2b54c661c097a8132 -size 998304 +oid sha256:d16c66ed2434715b264617d6c4c36e17caffbac2463af5885a3d871c7409df4c +size 997499 diff --git a/Docs/Steam/source/logo_clean.png b/Docs/Steam/source/logo_clean.png index 5f64285..9e815d2 100644 --- a/Docs/Steam/source/logo_clean.png +++ b/Docs/Steam/source/logo_clean.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7cdba1d0a3bed546b6ff8fac4819f39778346ab46b8c6c98ed010f40b946c614 -size 946680 +oid sha256:7d6bdaf68453d448d2621f6c79d14709b7a3c03e8fd01d613475df64c0523abf +size 936816 diff --git a/Tools/ui/logo_t.py b/Tools/ui/logo_t.py index 01f6a74..56a1ddb 100644 --- a/Tools/ui/logo_t.py +++ b/Tools/ui/logo_t.py @@ -1,9 +1,12 @@ -"""Replace the scythe standing in for the first T of CUTTERS with a copy of the second T. +"""Replace the scythe standing in for the first T of CUTTERS with a plain T. - py -I Tools/ui/logo_t.py in.png out.png [preview.png] + py -I Tools/ui/logo_t.py original.png out.png [preview.png] -The second T (white letter) is copied left by the letter pitch of the word, given a dark outline as thick as the -rest of the logo's, and the scythe pixels (orange handle, grey head, pale blade) are cleared or blacked in. + The originals are the scythe versions in git before 88c1ee9: Assets/Art/UI/logo_grasscutter.png and Docs/Steam/source/logo_clean.png. + +Works from the ORIGINAL logo (the one with the scythe). The second T had its top-left corner cut away where the +scythe blade lay over it, so the T is rebuilt symmetric (its right half mirrored onto the left), used for both Ts, +and the dark outline between U and E is drawn again from scratch at the logo's own thickness. """ import sys import numpy as np @@ -11,87 +14,97 @@ from PIL import Image from scipy import ndimage as nd src, dst = sys.argv[1], sys.argv[2] -im = np.array(Image.open(src).convert("RGBA")).astype(np.int32) +im = np.array(Image.open(src).convert("RGBA")).astype(np.float64) H, W = im.shape[:2] -r, g, b, a = im[..., 0], im[..., 1], im[..., 2], im[..., 3] +r, g, b, a = (im[..., i] for i in range(4)) mx, mn = np.maximum(np.maximum(r, g), b), np.minimum(np.minimum(r, g), b) solid = a > 128 white = solid & (mn > 200) & (mx - mn < 30) dark = solid & (mx < 90) orange = solid & (r > 150) & (r - b > 80) & (g < 200) -grey = solid & (mx - mn < 35) & (mn > 100) & (mn <= 215) -# letters: big white components. The middle row (CUTTERS) is the band holding the orange handle. lab, n = nd.label(white) objs = nd.find_objects(lab) sizes = nd.sum(white, lab, range(1, n + 1)) ys, xs = np.nonzero(orange) -hx0, hx1, hy0, hy1 = xs.min(), xs.max(), ys.min(), ys.max() +hx0, hy0, hy1 = xs.min(), ys.min(), ys.max() row_mid = (hy0 + hy1) / 2 -letters = [] -for i, sl in enumerate(objs): - if sizes[i] < 0.002 * H * W: - continue - y0, y1, x0, x1 = sl[0].start, sl[0].stop, sl[1].start, sl[1].stop - if y0 < row_mid < y1: - letters.append((x0, i + 1, x1, y0, y1)) -letters.sort() -print("row letters (x0..x1):", [(l[0], l[2]) for l in letters]) -# the first letter right of the handle is the second T, the one after it is E; the one left of it is U -right = [l for l in letters if l[0] > hx0] -left = [l for l in letters if l[2] < hx0 + 5] +row = sorted((sl[1].start, i + 1, sl[1].stop, sl[0].start, sl[0].stop) for i, sl in enumerate(objs) + if sizes[i] >= 0.002 * H * W and sl[0].start < row_mid < sl[0].stop) +right = [l for l in row if l[0] > hx0] +u = [l for l in row if l[2] < hx0 + 5][-1] t2, e = right[0], right[1] -u = left[-1] -# T1 goes halfway between U and T2 so both gaps match -gap_te = e[0] - t2[2] -w_t = t2[2] - t2[0] -x_new = int(round((u[2] + t2[0] - w_t) / 2)) -dx = x_new - t2[0] -print(f"U ends {u[2]}, T2 {t2[0]}..{t2[2]}, E starts {e[0]}; new T at {x_new} (dx {dx})") +print("U", u[0], u[2], "T2", t2[0], t2[2], "E", e[0], e[2]) -t2mask = lab == t2[1] -newT = np.zeros_like(t2mask) -if dx < 0: - newT[:, :W + dx] = t2mask[:, -dx:] -# outline thickness: distance from the T2 white to the transparent outside, measured across its stem's left side -dist_out = nd.distance_transform_edt(~solid) -outline = int(np.percentile(nd.distance_transform_edt(~t2mask)[(solid) & (~white) & (nd.binary_dilation(t2mask, iterations=40)) & (~nd.binary_dilation(t2mask, iterations=3))], 95)) -outline = max(8, min(outline, 60)) -print("outline px", outline) +# every letter of the logo, minus the scythe's pale blade (a white blob sitting between U and T2) +letters = np.zeros_like(white) +for i, sl in enumerate(objs): + if sizes[i] < 0.0005 * H * W: + continue + x0, x1 = sl[1].start, sl[1].stop + if x0 >= u[2] - 2 and x1 <= t2[0] + 40 and sl[0].stop <= t2[4] + 5 and (i + 1) not in (u[1], t2[1]): + continue + letters |= lab == i + 1 -# the scythe: everything light or coloured between U and T2, from the top of the handle to its foot, that is not one of the letters -box = np.zeros_like(solid) -box[max(0, hy0 - 15):hy1 + 15, u[2] - 10:t2[0] + 30] = True -scythe = box & solid & ~dark & ~np.isin(lab, [u[1], t2[1]]) -scythe = nd.binary_dilation(scythe, iterations=3) & solid & box & ~np.isin(lab, [u[1], t2[1]]) -big = np.isin(lab, [l[1] for l in letters]) +# outline thickness: how far the dark band reaches past the letters on the logo's outer edge, away from the scythe +d_let = nd.distance_transform_edt(~letters) +edge = solid & ~nd.binary_erosion(solid) +far = np.ones_like(solid) +far[:, u[0]:e[2]] = False +outline = float(np.median(d_let[edge & far])) +print("outline", outline) + +# the T, symmetric about its stem +t2m = lab == t2[1] +y0, y1 = t2[3], t2[4] +low = range(y0 + int((y1 - y0) * 0.6), y1 - 4) +cx = int(round(np.mean([np.nonzero(t2m[y])[0].mean() for y in low if t2m[y].any()]))) +half = t2[2] - cx + 3 +sym = np.zeros_like(t2m) +px = np.zeros_like(im) +for x in range(cx, cx + half): + m = 2 * cx - x + sym[:, x] = t2m[:, x] + sym[:, m] = t2m[:, x] + px[:, x] = im[:, x] + px[:, m] = im[:, x] +# the new T halfway between U and T2 (same gap on both sides) +gap = (cx - half - u[2] - 2 * half) / 2 +dx = int(round(u[2] + gap + half - cx)) +newT = np.zeros_like(sym) +newpx = np.zeros_like(px) +newT[:, cx + dx - half:cx + dx + half] = sym[:, cx - half:cx + half] +newpx[:, cx + dx - half:cx + dx + half] = px[:, cx - half:cx + half] +print("stem", cx, "half", half, "new T stem", cx + dx) + +# redraw the band from U's right edge to halfway into the T2-E gap +x_lo, x_hi = u[2] + 1, (t2[2] + e[0]) // 2 +y_lo, y_hi = max(0, t2[3] - int(outline) - 30), min(H, t2[4] + int(outline) + 30) +R = np.zeros_like(solid) +R[y_lo:y_hi, x_lo:x_hi] = True +keep = letters & ~t2m # other letters' whites (GRASS bottoms, TOGETHER tops, U's edge) as they were +new_white = keep | sym | newT +d = nd.distance_transform_edt(~new_white) +dark_col = np.median(im[dark][:, :3], axis=0) out = im.copy() -# what the outline of everything else covers stays dark, the rest of the scythe goes transparent -keep_dark = nd.distance_transform_edt(~(white & ~scythe)) <= outline + 1 -ring = nd.distance_transform_edt(~newT) <= outline -dark_col = np.median(im[dark & ~scythe][:, :3], axis=0).astype(np.int32) -clear = scythe & ~keep_dark & ~ring -out[clear] = 0 -# gaps the handle left inside the word (between it and T2) are closed up: transparent pockets in the box that the filled silhouette surrounds -pocket = box & (a < 250) & nd.binary_fill_holes(solid | ring) -# inside the box every solid pixel off the letters (and their soft edges) becomes plain outline: no ghost of the handle's edge -letters_soft = nd.binary_dilation(np.isin(lab, [u[1], t2[1]]), iterations=1) | nd.binary_dilation(newT, iterations=2) -fill = (scythe & (keep_dark | ring)) | (ring & ~solid) | pocket | (box & (solid | ring) & ~letters_soft & (keep_dark | ring)) -out[fill, :3] = dark_col -out[fill, 3] = 255 -# the letter itself: the T2 pixels copied across with their shading -for c in range(4): - plane = out[..., c] - shifted = np.zeros_like(plane) - shifted[:, :W + dx] = im[:, -dx:, c] - soft = nd.binary_dilation(newT, iterations=2) - plane[soft] = shifted[soft] -# soften the outer edge of the new outline a touch -edge = ring & ~nd.binary_erosion(ring, iterations=1) & ~solid -out[edge, 3] = 200 -Image.fromarray(out.clip(0, 255).astype(np.uint8)).save(dst) +band = R & ~nd.binary_dilation(keep, iterations=2) +cov = np.clip(outline + 0.5 - d, 0.0, 1.0) # outline coverage with a soft 1 px outer edge +out[band, :3] = dark_col +# never less than the logo already covered there (rows close together share one dark mass) +out[band, 3] = np.maximum(cov[band] * 255, a[band]) +# a pocket the old handle left between the two stems, now walled in: fill it +pocket = band & nd.binary_fill_holes(out[..., 3] > 128) & (out[..., 3] < 255) +out[pocket, 3] = 255 +for mask, pix in ((sym, px), (newT, newpx)): + soft = nd.binary_dilation(mask, iterations=2) & R + al = pix[soft, 3:4] / 255.0 + # the copied pixels carry their own anti-aliased edge over the dark outline + out[soft, :3] = pix[soft, :3] * al + dark_col * (1 - al) + out[soft, 3] = 255 +res = Image.fromarray(out.clip(0, 255).astype(np.uint8)) +res.save(dst) if len(sys.argv) > 3: - prev = Image.new("RGBA", (W, H), (40, 60, 80, 255)) - prev.alpha_composite(Image.fromarray(out.clip(0, 255).astype(np.uint8))) + prev = Image.new("RGBA", (W, H), (90, 160, 60, 255)) + prev.alpha_composite(res) prev.convert("RGB").save(sys.argv[3]) print("saved", dst)