     } case ;
 
 : scale-greyscale ( byte-array loading-png -- byte-array' )
-    bit-depth>> dup 8 >= [
-        drop
-    ] [
-        scale-factor '[ _ * ] B{ } map-as
-    ] if ;
+    bit-depth>> {
+        { 8 [ ] }
+        { 16 [ 2 group [ swap ] assoc-map B{ } concat-as ] }
+        [ scale-factor '[ _ * ] B{ } map-as ]
+    } case ;
 
 : decode-greyscale ( loading-png -- byte-array )
     [ raw-bytes ] keep scale-greyscale ;

USING: accessors arrays checksums checksums.crc32 combinators
compression.inflate fry grouping images images.loader io
io.binary io.encodings.ascii io.encodings.string kernel locals
math math.bitwise math.ranges sequences sorting ;
QUALIFIED-WITH: bitstreams bs
IN: images.png


            validate-indexed-color unimplemented-color-type
        ] }
        { greyscale-alpha [
            validate-greyscale-alpha decode-greyscale-alpha LA
        ] }
        { truecolor-alpha [
            validate-truecolor-alpha raw-bytes RGBA
