Spaces:
Paused
Paused
Savestate: Update app logo and remove white frame
Browse files- crop_logo.py +44 -0
- index.html +1 -1
- public/new-logo.png +3 -0
- public/schoolmind-logo-gemini.png +2 -2
- public/schoolmind-logo-new.png +3 -0
- public/schoolmind-logo-transparent.png +2 -2
- public/schoolmind-logo.png +2 -2
crop_logo.py
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from PIL import Image
|
| 2 |
+
|
| 3 |
+
def process_logo(input_path, output_path):
|
| 4 |
+
try:
|
| 5 |
+
img = Image.open(input_path).convert("RGBA")
|
| 6 |
+
data = img.getdata()
|
| 7 |
+
width, height = img.size
|
| 8 |
+
|
| 9 |
+
left, right, top, bottom = width, 0, height, 0
|
| 10 |
+
|
| 11 |
+
for y in range(height):
|
| 12 |
+
for x in range(width):
|
| 13 |
+
r, g, b, a = data[y * width + x]
|
| 14 |
+
if not (r > 245 and g > 245 and b > 245):
|
| 15 |
+
if x < left: left = x
|
| 16 |
+
if x > right: right = x
|
| 17 |
+
if y < top: top = y
|
| 18 |
+
if y > bottom: bottom = y
|
| 19 |
+
|
| 20 |
+
if left < right and top < bottom:
|
| 21 |
+
# add a slight inset to avoid fringe
|
| 22 |
+
inset = 2
|
| 23 |
+
left += inset
|
| 24 |
+
top += inset
|
| 25 |
+
right -= inset
|
| 26 |
+
bottom -= inset
|
| 27 |
+
|
| 28 |
+
cropped = img.crop((left, top, right + 1, bottom + 1))
|
| 29 |
+
datas = cropped.getdata()
|
| 30 |
+
newData = []
|
| 31 |
+
for item in datas:
|
| 32 |
+
if item[0] > 230 and item[1] > 230 and item[2] > 230:
|
| 33 |
+
newData.append((0, 0, 0, 0))
|
| 34 |
+
else:
|
| 35 |
+
newData.append(item)
|
| 36 |
+
cropped.putdata(newData)
|
| 37 |
+
cropped.save(output_path, "PNG")
|
| 38 |
+
print(f"Success. Cropped box: {left}, {top}, {right}, {bottom}")
|
| 39 |
+
else:
|
| 40 |
+
print("No non-white pixels found.")
|
| 41 |
+
except Exception as e:
|
| 42 |
+
print(f"Error: {e}")
|
| 43 |
+
|
| 44 |
+
process_logo("C:/Antigravity/APP/public/new-logo.png", "C:/Antigravity/APP/public/schoolmind-logo-new.png")
|
index.html
CHANGED
|
@@ -74,7 +74,7 @@
|
|
| 74 |
</head>
|
| 75 |
<body class="dark-theme in-chat-view">
|
| 76 |
|
| 77 |
-
<div id="live-version-badge" style="position: fixed; top: 50px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--text-secondary); opacity: 0.6; z-index: 99999; pointer-events: none; font-weight: 500; font-family: monospace; letter-spacing: 1px; background: rgba(0,0,0,0.2); padding: 2px 8px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.05);">BUILD 1.8.
|
| 78 |
|
| 79 |
<!-- SVG Filters for Liquid Glass Refraction -->
|
| 80 |
<svg width="0" height="0" style="position: absolute; pointer-events: none;">
|
|
|
|
| 74 |
</head>
|
| 75 |
<body class="dark-theme in-chat-view">
|
| 76 |
|
| 77 |
+
<div id="live-version-badge" style="position: fixed; top: 50px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--text-secondary); opacity: 0.6; z-index: 99999; pointer-events: none; font-weight: 500; font-family: monospace; letter-spacing: 1px; background: rgba(0,0,0,0.2); padding: 2px 8px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.05);">BUILD 1.8.238</div>
|
| 78 |
|
| 79 |
<!-- SVG Filters for Liquid Glass Refraction -->
|
| 80 |
<svg width="0" height="0" style="position: absolute; pointer-events: none;">
|
public/new-logo.png
ADDED
|
Git LFS Details
|
public/schoolmind-logo-gemini.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
public/schoolmind-logo-new.png
ADDED
|
Git LFS Details
|
public/schoolmind-logo-transparent.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
public/schoolmind-logo.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|