pixie.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:remorse 作者: joe-ds 项目源码 文件源码
def encode(image, number):
    '''Encodes the key into the image. Note: number is the str of a bin!'''
    width, height = image.size

    # Make sure that the image is large enough
    if width < len(number):
        return False
    line = randint(0,height)
    column = width - len(number) -1
    px = image.load()
    for i, char in enumerate(number):
        i += column
        color = ((px[i, line][2] // 10) * 10) + int(char)
        px[i, line]= (px[i,line][0], px[i,line][1], color)
    image.save('encoded.png', 'PNG', quality=100)
    return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号