I managed to solve the problem in a way that was good enough - it's probably not optimal though.
Make a 2D array with the dimensions of the bitmap. For every pixel in the bitmap that's black make the corresponding element WALL, otherwise EMPTY_SPACE.
Scan the array left-right, top to bottom for the first EMPTY_SPACE. Save this coordinate.
Create a rectangle of area 1 with the topleft coordinate set to the coordinate found at 2, extending 1 downwards and to the right.
Horizontally extend the rectangle to the left and to the right as long as it doesn't cover any WALL.
Vertically extend the rectangle up and down as long as it doesn't cover any WALL.
Mark any element covered by the rectangle as a COVERED_SPACE and add the rectangle to the set of rectangles.
If there is still an element containing EMPTY_SPACE left goto 2, otherwise you're done.