0
点赞
收藏
分享

微信扫一扫

反差色图片隐写

米小格儿 2022-07-27 阅读 70


抽取反差色图像是每个像素跟0x1位与运算,结果为0的像素,设置为0,其他设置为255。

from PIL import Image
img = Image.open('01.jpg')
width,height=img.size
for i in range(0,width):
for j in range(0,height):
tmp = img.getpixel((i,j))
if tmp&0x1 == 0:
img.putpixel((i,j),0)
else:
img.putpixel((i,j),255)
img.show()

反差色图片隐写_与运算


反差色图片隐写_与运算_02


举报

相关推荐

0 条评论