黑白照片

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from PIL import Image

im = Image.open('3.png')
width,height = im.size

bin = ''

for x in range(width):
for y in range(height):
r,g,b = im.getpixel((x,y))
if r > 127:
bin += '1'
else:
bin += '0'

with open('flag1_out.txt','w')as f:
f.write(bin)

1742701752141-771f6375-4ba3-4bf1-922f-41e8808e56d1.png

1742700847185-689593d6-5420-43be-9ff0-25cdc47d22bf.png

更新: 2025-03-23 11:49:28
原文: https://www.yuque.com/chaye-apqbl/vsc85q/dfvz5vsxme4tygob


http://example.com/2026/01/19/MISC/照片/黑白照片/
Author
chaye
Posted on
January 19, 2026
Licensed under