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

    ] when

    height [
        8 bs bs:read
        count [ depth bs bs:read ] replicate swap prefix
        8 bs bs:align
    ] replicate

: 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 )
