def create_masks(degree):
    """
    Create masks for taking bits from text bytes and
    putting them to image bytes.

    :param degree: number of bits from byte that are taken to encode text data in image
    :return: a mask for a text and a mask for an image
    """
    text_mask = 255
    img_mask = 255
    text_mask <<= 8 - degree
    text_mask %= 256
    img_mask >>= degree
    img_mask <<= degree
    return text_mask, img_mask
