Playing with pbm in P4 is simple.
BUT. If i have TRUE pbm in P1 i have some fun.
I can write pbm file
P1
# cool image
7 7
0001000
0011100
0111110
1111111
0011100
0011100
0011100
I can convert it into 1 string
Code: Select all
with open('arrow.pbm') as f:
data_list = f.readlines()
# for framebuffer
[width, hight] = (data_list[2].split())
body = ''
body += body.join(data_list[3:]).replace('\n', '')
i mean i must encode all binary characters into bytes. but how?
where is instruction about bytes? (crying)