 
 : validate-truecolor-alpha ( loading-png -- loading-png )
     { 8 16 } validate-bit-depth ;
-
-: decode-greyscale-alpha ( loading-image -- byte-array' )
-    [ raw-bytes ] [ bit-depth>> ] bi 16 = [
-        4 group [ first4 [ swap ] 2dip 4array ] map B{ } concat-as
-    ] when ;
 
 : loading-png>bitmap ( loading-png -- bytes component-order )
     dup color-type>> {

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

    } cleave ;

: find-compressed-bytes ( loading-png -- bytes )
    "IDAT" find-chunks [ data>> ] map concat ;

ERROR: unknown-color-type n ;
ERROR: unimplemented-color-type image ;
