         [ unknown-component-order ]
     } case ;
 
-: fill-image-slots ( bitmap -- bitmap )
-    dup {
+: loading-bitmap>bitmap-image ( loading-bitmap -- bitmap-image )
+    [ bitmap-image new ] dip
+    {
+        [ raw-bitmap>seq >>bitmap ]
         [ [ width>> ] [ height>> ] bi 2array >>dim ]
         [ bitmap>component-order >>component-order ]
-        [ bitmap>> >>bitmap ]
     } cleave ;
 
-M: bitmap-image load-image* ( path bitmap -- bitmap )
-    load-bitmap-data process-bitmap-data
-    fill-image-slots ;
+M: bitmap-image load-image* ( path loading-bitmap -- bitmap )
+    drop loading-bitmap new
+    load-bitmap-data loading-bitmap>bitmap-image ;
 
 MACRO: (nbits>bitmap) ( bits -- )
     [ -3 shift ] keep '[
-        bitmap-image new
+        loading-bitmap new
             2over * _ * >>size-image
             swap >>height
             swap >>width
             swap array-copy [ >>bitmap ] [ >>color-index ] bi
-            _ >>bit-count fill-image-slots
-            t >>upside-down?
+            _ >>bit-count
     ] ;
 
 : bgr>bitmap ( array height width -- bitmap )

            40 write4
        ] [
            {
                [ dim>> first2 [ write4 ] bi@ ]
                [ drop 1 write2 ]
                [ drop 24 write2 ]
                [ drop 0 write4 ]
                [ bitmap>> bitmap>color-index length write4 ]
                [ drop 0 write4 ]
                [ drop 0 write4 ]
                [ drop 0 write4 ]
                [ drop 0 write4 ]
                ! rgb-quads
                [ bitmap>> bitmap>color-index write ]
            } cleave

    dup rgb-quads-length read >>rgb-quads
    dup color-index-length read >>color-index ;

: load-bitmap-data ( path loading-bitmap -- loading-bitmap )
    [ binary ] dip '[
        _ parse-file-header parse-bitmap-header parse-bitmap
    ] with-file-reader ;

ERROR: unknown-component-order bitmap ;

