From 12e35fd2a02284c18fb6ff96c8a49d8f53401d44 Mon Sep 17 00:00:00 2001 From: Zack Buhman Date: Fri, 25 Apr 2025 22:57:16 -0500 Subject: [PATCH] add assert_mipmap --- assert_mipmap.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 assert_mipmap.py diff --git a/assert_mipmap.py b/assert_mipmap.py new file mode 100644 index 0000000..2500c4e --- /dev/null +++ b/assert_mipmap.py @@ -0,0 +1,15 @@ +from PIL import Image +import sys +from twiddle import npot + +total = 0 + +in_files = sys.argv[1:] +for in_file in in_files: + with Image.open(in_file) as im: + width, height = im.size + assert npot(width) == npot(width), width + assert npot(height) == npot(height), height + if width != height: + print(width, height, in_file) + total += width * height