Files
nearle_web_nextjs/scratch/inspect_logo.py
2026-06-20 15:41:55 +05:30

25 lines
853 B
Python

from PIL import Image
def inspect_logo(path):
img = Image.open(path)
print("Mode:", img.mode)
print("Size:", img.size)
pixels = img.convert("RGBA").load()
width, height = img.size
# Check what colors exist in the image
colors = {}
for x in range(width):
for y in range(height):
r, g, b, a = pixels[x, y]
if a > 0:
color = (r, g, b, a)
colors[color] = colors.get(color, 0) + 1
print("Opaque / Semi-transparent pixels color counts (top 15):")
for color, count in sorted(colors.items(), key=lambda x: x[1], reverse=True)[:15]:
print(f"Color: {color}, count: {count}")
if __name__ == "__main__":
inspect_logo("/Users/apple/.gemini/antigravity-ide/brain/822556bd-47a7-4c07-8975-803618af0a3a/media__1781942586218.png")