             40 write4
         ] [
             {
+                ! width height
                 [ dim>> first2 [ write4 ] bi@ ]
+
+                ! planes
                 [ drop 1 write2 ]
+
+                ! bit-count
                 [ drop 24 write2 ]
+
+                ! compression
                 [ drop 0 write4 ]
+
+                ! size-image
                 [ bitmap>> bitmap>color-index length write4 ]
+
+                ! x-pels
                 [ drop 0 write4 ]
+
+                ! y-pels
                 [ drop 0 write4 ]
+
+                ! color-used
                 [ drop 0 write4 ]
+
+                ! color-important
                 [ drop 0 write4 ]
+
                 ! rgb-quads
                 [ bitmap>> bitmap>color-index write ]
             } cleave

    read4 >>color-used
    read4 >>color-important ;

: rgb-quads-length ( bitmap -- n )
    [ offset>> 14 - ] [ header-length>> ] bi - ;

: color-index-length ( bitmap -- n )
    {
        [ width>> ]
        [ planes>> * ]

        [ unknown-component-order ]
    } case ;

: 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 ]
    } cleave ;

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 '[
        loading-bitmap new
            2over * _ * >>size-image
            swap >>height
            swap >>width
            swap array-copy [ >>bitmap ] [ >>color-index ] bi
            _ >>bit-count
    ] ;

: bgr>bitmap ( array height width -- bitmap )
