aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Oliver <contact@pauloliver.dev>2024-02-29 01:50:44 +0100
committerPaul Oliver <contact@pauloliver.dev>2024-02-29 01:50:44 +0100
commit2ffd2147ff8937df1b9a5798cb7dc584059e0597 (patch)
tree1477e153d98d8dd378437bbfc4d64bdf336c80da
parent3f2f5f9403ac43b57afc246c4f27d3138f81863a (diff)
Imager made to return grayscale images.
-rwxr-xr-xplugins/imager.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/imager.py b/plugins/imager.py
index 7c26092..84d6ca2 100755
--- a/plugins/imager.py
+++ b/plugins/imager.py
@@ -22,14 +22,14 @@ salis.sm_getSize.restype = c_uint
def makeImage(iname):
salis.s_load(bytes(iname, "utf-8"))
lsize = int(salis.sm_getSize() ** 0.5)
- image = Image.new("RGB", (lsize, lsize), "black")
+ image = Image.new("L", (lsize, lsize), "black")
pixels = image.load()
for y in range(lsize):
for x in range(lsize):
addr = (y * lsize) + x
byte = salis.sm_getByteAt(addr)
- pixels[x, y] = (byte // 4, byte // 2, byte)
+ pixels[x, y] = byte
salis.s_quit()
oname = iname + ".png"