Initial commit
This commit is contained in:
24
scratch/inspect_logo.py
Normal file
24
scratch/inspect_logo.py
Normal file
@@ -0,0 +1,24 @@
|
||||
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")
|
||||
Reference in New Issue
Block a user