 : decode-indexed-color ( loading-image -- byte-array )
     [ raw-bytes ] keep "PLTE" find-chunk data>> verify-PLTE
     3 group '[ _ nth ] { } map-as B{ } concat-as ; inline
- 
+
 ERROR: invalid-color-type/bit-depth loading-png ;
 
 : validate-bit-depth ( loading-png seq -- loading-png )

: uncompress-bytes ( loading-png -- bitstream )
    [ inflate-data ] [ interlace-method>> ] bi reverse-interlace ;

:: raw-bytes ( loading-png -- array )
    loading-png uncompress-bytes :> bs
    loading-png width>> :> width

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

