Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- height = getHeight();
- width = getWidth();
- v = newArray(width*height);
- for(y = 1; y < height-1; y++){
- for(x = 1; x < width-1; x++){
- 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){
- v[x+y*width] = 0;
- }else{
- v[x+y*width] = 255;
- }
- }
- }
- for(y = 1; y < height-1; y++){
- for(x = 1; x < width-1; x++){
- setPixel(x, y, v[x+y*width]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement