about summary refs log tree commit diff stats
path: root/src/img
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-06-29 21:53:19 +0200
committerbptato <nincsnevem662@gmail.com>2023-06-29 21:53:19 +0200
commitef136ac44db26074bf9528f17dee764f731ed4eb (patch)
tree228cab22145defd6ee74635a38ab0e93436359f1 /src/img
parenta7b784589a6667865669d54db801e975ad3d5cd1 (diff)
downloadchawan-ef136ac44db26074bf9528f17dee764f731ed4eb.tar.gz
png: fix grayscale regression
it's 0x1, not 0x11. oops
Diffstat (limited to 'src/img')
-rw-r--r--src/img/png.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/img/png.nim b/src/img/png.nim
index 44630420..247c3395 100644
--- a/src/img/png.nim
+++ b/src/img/png.nim
@@ -292,7 +292,7 @@ proc writepxs(reader: var PNGReader, crow: var openArray[RGBAColor]) =
     for x in 0 ..< crow.len:
       let u = reader.uprow[i]
       let n = case reader.bitDepth
-      of 1: ((u shr (7 - j)) and 0x11) * 255
+      of 1: ((u shr (7 - j)) and 0x1) * 255
       of 2: ((u shr (6 - j)) and 0x3) * 85
       of 4: ((u shr (4 - j)) and 0xF) * 17
       of 8: u