def get_imagesize(framedim, nbbits_per_pixel, headersize_bytes):
    """
    return size of image in byte (= 1 octet = 8 bits)
    """
    return (framedim[0] * framedim[1] * nbbits_per_pixel + headersize_bytes * 8
        ) // 8
