             validate-greyscale decode-greyscale L
         ] }
         { truecolor [
-            validate-truecolor raw-bytes RGB
+            validate-truecolor uncompress-bytes RGB
         ] }
         { indexed-color [
             validate-indexed-color decode-indexed-color RGB

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 assocs
math.functions math.order ;
QUALIFIED-WITH: bitstreams bs
IN: images.png


    dup length 3 divisor? [ invalid-PLTE ] unless ;

: decode-indexed-color ( loading-image -- byte-array )
    [ uncompress-bytes ] keep
    "PLTE" find-chunk data>> verify-PLTE
    3 group '[ _ nth ] { } map-as B{ } concat-as ;

ERROR: invalid-color-type/bit-depth loading-png ;

