mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-29 10:49:53 +02:00
recenter linux icon
This commit is contained in:
@@ -1,7 +1,16 @@
|
||||
import sys
|
||||
from PIL import Image
|
||||
image = Image.open(sys.argv[1])
|
||||
|
||||
with open(sys.argv[1], "rb") as icon:
|
||||
output = ""
|
||||
formatted = []
|
||||
for pixel in image.getdata():
|
||||
formatted.extend("0x{0:02X}".format(byte) for byte in pixel)
|
||||
for i in range(len(formatted)/16 + 1):
|
||||
print(", ".join(formatted[i*16:(i+1)*16]) + ",")
|
||||
|
||||
"""with open(sys.argv[1], "rb") as icon:
|
||||
icondata = icon.read()
|
||||
output = ["0x{0:02X}".format(ord(byte)) for byte in icondata]
|
||||
for line in range(len(output)/16+1):
|
||||
print(", ".join(output[line*16:(line+1)*16])+",")
|
||||
print(", ".join(output[line*16:(line+1)*16])+",")"""
|
||||
|
Reference in New Issue
Block a user