Revisions for untitled paste

View the changes made to this paste.

unlisted ⁨1⁩ ⁨file⁩ 2021-09-10 20:19:07 UTC

PICT Tool

@@ -0,0 +1,22 @@

+# ImageBuilder PICT tool by Raccoon Sam
+# Be sure to have Pillow for Python installed!
+from PIL import Image
+import struct
+
+# Change the dimensions to whatever necessary
+# I recommend using TiledGGD to discover the proper dimensions
+# Import a raw file into TiledGGD and view it at 32bpp RGB
+width, height = 50, 60
+
+canvas = Image.new("RGBA", (width, height))
+
+# Change the file directories to whatever necessary
+with open("/Users/Foobar/EXAMPLE_FILE.PICT", "rb") as rom:
+    data = []
+    
+    for i in range(0, width*height):
+        a,r,g,b = struct.unpack("BBBB", rom.read(4))
+        data.append((r, g, b, 255-a))
+    
+    canvas.putdata(data)
+    canvas.save("/Users/Foobar/EXAMPLE_FILE.PNG")