Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /usr/bin/sdlbrt
- finp$="file.png":fout$=finp$+".chr"
- setdisplay(128,128,32,1):paper(8^8-1):ink(0):pen(0):cls
- loadimage(finp$,1):pasteicon(0,0,1)
- open fout$ for output as #1
- for i=0 to 4095:
- y1=int(i/256)
- x1=(int(i/16))mod 16
- y2=i mod 8
- bm=(int (i/8))mod 2
- ctr=0
- for b=7 to 0 step -1:
- c=((int(point(x1*8+b,y1*8+y2)/256))mod 256)*59
- c+=((int(point(x1*8+b,y1*8+y2)/65536))mod 256)*30
- c+=(point(x1*8+b,y1*8+y2) mod 256)*11
- c=int(c/100)
- if (bm=0 and (int(c/64)mod 2)=1) or (bm=1 and (int(c/128)mod 2)=1) then:
- ctr+=2^(7-b): end if
- next
- writebyte(1,ctr)
- next
- close #1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement