Capture Neko/WG/network hubs, Studio viewer charts, physical deploy docs, and one-shot scripts so VPS vs physical can be toggled later without losing WIP. Co-authored-by: Cursor <cursoragent@cursor.com>
31 lines
1.0 KiB
Python
31 lines
1.0 KiB
Python
"""Convert favicon_concept.png to ico + multiple png sizes for Next.js."""
|
|
from PIL import Image
|
|
import os
|
|
|
|
SRC = r"C:\Users\admin\.cursor\projects\c-Users-admin-Desktop-douyinWEB\assets\favicon_concept.png"
|
|
OUT_DIR = r"C:\Users\admin\Desktop\douyinWEB\frontend\public"
|
|
|
|
img = Image.open(SRC).convert("RGBA")
|
|
|
|
# favicon.ico (multi-size)
|
|
ico_sizes = [(16,16),(32,32),(48,48),(64,64)]
|
|
imgs = [img.resize(s, Image.LANCZOS) for s in ico_sizes]
|
|
ico_path = os.path.join(OUT_DIR, "favicon.ico")
|
|
imgs[0].save(ico_path, format="ICO", sizes=[(s[0],s[1]) for s in ico_sizes], append_images=imgs[1:])
|
|
print(f"saved {ico_path}")
|
|
|
|
# apple-touch-icon.png (180x180)
|
|
apple = img.resize((180,180), Image.LANCZOS)
|
|
apple_path = os.path.join(OUT_DIR, "apple-touch-icon.png")
|
|
apple.save(apple_path, "PNG")
|
|
print(f"saved {apple_path}")
|
|
|
|
# icon-192.png and icon-512.png for PWA
|
|
for size in [192, 512]:
|
|
out = img.resize((size,size), Image.LANCZOS)
|
|
p = os.path.join(OUT_DIR, f"icon-{size}.png")
|
|
out.save(p, "PNG")
|
|
print(f"saved {p}")
|
|
|
|
print("done")
|