Advertisement
Guest User

Untitled

a guest
May 27th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. height = getHeight();
  2. width = getWidth();
  3.  
  4. v = newArray(width*height);
  5.  
  6. for(y = 1; y < height-1; y++){
  7. for(x = 1; x < width-1; x++){
  8. if(getPixel(x,y) != 255 && getPixel(x-1,y+1) != 255 && getPixel(x+1,y-1) != 255 && getPixel(x-1,y-1) != 255 && getPixel(x+1,y+1) != 255){
  9. v[x+y*width] = 0;
  10. }else{
  11. v[x+y*width] = 255;
  12. }
  13. }
  14. }
  15.  
  16. for(y = 1; y < height-1; y++){
  17. for(x = 1; x < width-1; x++){
  18. setPixel(x, y, v[x+y*width]);
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement