about summary refs log tree commit diff stats
path: root/src/img
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-06-05 12:56:52 +0200
committerbptato <nincsnevem662@gmail.com>2023-06-05 13:36:52 +0200
commit86c133f37ec41e4dce39c692696228e8151fe75c (patch)
treed45ff1ad9ae79db18c9d7edbfac1f96651abd4bd /src/img
parent8027e52cb221c432bed64517015ebf3182e6166d (diff)
downloadchawan-86c133f37ec41e4dce39c692696228e8151fe75c.tar.gz
Fix 16bit grayscale bug
Diffstat (limited to 'src/img')
-rw-r--r--src/img/bitmap.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/img/bitmap.nim b/src/img/bitmap.nim
index 03048f4d..f944ad59 100644
--- a/src/img/bitmap.nim
+++ b/src/img/bitmap.nim
@@ -436,7 +436,7 @@ proc writepxs(reader: var PNGReader, crow: var openArray[RGBAColor]) =
       of 2: ((u shr (6 - j)) and 3) * 85
       of 4: ((u shr (6 - j)) and 15) * 17
       of 8: u
-      of 16: u div 2
+      of 16: u # we ignore the lower 8 bits.
       else: 0
       j += int(reader.bitDepth)
       i += j div 8