def expand_rect_mask_debug(gia, bits, abs_rect):
    """ Take a rectangle-mask that is smaller than full-size (probably),
        and expand it to size of the entire image. Purely for debugging output.
    :param gia: general-image attributes - originally a global, contains height/width, etc
    :param bits: greyscale bitmap (0, 0, 0, 0, 250, 255, ...)
    :param abs_rect: outer-border coordinates of rectangle-mask
    :return: greyscale bitmap, with dimensions matching the entire image (0, 0, 0, 0, 250, 255, ...)
    """
    pic_width = gia['width']
    pic_height = gia['height']
    black_bitmap = [(0) for _ in range(pic_width * pic_height)]
    tl_x = abs_rect.tl_x
    tl_y = abs_rect.tl_y
    rect_width = abs_rect.width
    rect_height = abs_rect.height
    for y in range(rect_height):
        for x in range(rect_width):
            pixel_loc = x + y * rect_width
            new_pixel_loc = x + tl_x + (y + tl_y) * pic_width
            black_bitmap[new_pixel_loc] = bits[pixel_loc]
    return black_bitmap
