@staticmethod
def is_pow2(size):
    """Is this an even power of two size?"""
    if size < 0:
        raise ValueError('Negative image size???')
    while not size & 1 and size > 1:
        size = size >> 1
    if size == 1:
        return True
    return False
