colourreducer_qlbbcmicro_post.lua 673 B

123456789101112131415161718192021222324252627282930
  1. w,h=getpicturesize()
  2. ok,xcell,ycell=inputbox("test","xcell",8,1,16,4,"ycell",8,1,16,4);
  3. --ok=inputbox("test");
  4. if ok==true then
  5. for y=0,h-1,1 do
  6. for x=0,w-1,1 do
  7. c=getpicturepixel(x,y)
  8. r,g,b=getcolor(c)
  9. c2=0
  10. if b>127 then
  11. c2=c2+1
  12. end
  13. if r>127 then
  14. c2=c2+2
  15. end
  16. if g>127 then
  17. c2=c2+4
  18. end
  19. putpicturepixel(x,y,c2)
  20. end;end
  21. for c=0,255,1 do
  22. setcolor(c,0,0,0)
  23. end
  24. setcolor(1,0x00,0x00,0xFF);setcolor(2,0xFF,0x00,0x00);setcolor(3,0xFF,0x00,0xFF)
  25. setcolor(4,0x00,0xFF,0x00);setcolor(5,0x00,0xFF,0xFF);setcolor(6,0xFF,0xFF,0x00)
  26. setcolor(7,0xFF,0xFF,0xFF)
  27. end