Advertisement
Guest User

Untitled

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