public static BufferedImage Maska(BufferedImage in,int... param){
        
        long start_time    = System.currentTimeMillis();
        BufferedImage out  = new BufferedImage( in.getWidth(), in.getHeight(), in.getType());
        int     width;
        int     heigth;
        
        width           = in.getWidth();
        heigth          = in.getHeight();
        
        in=RGB.powiekszBialymi(in,1);
        out=RGB.powiekszKopiujac(in,0);
        
        int waga        = 0;
        int straznik    = 0;
        int licznik     = 0;
        
        boolean zmiany;
        
        do{
            zmiany=false;
            
            for (int i = 0; i < width; i++) {
                for (int j = 0; j < heigth; j++) {
                            
                            if(RGB.getR(in.getRGB(i, j))==0){
                             
                            int a [][] = {  {RGB.getB(in.getRGB(i-1, j-1))/255,   RGB.getB(in.getRGB(i, j-1))/255,  RGB.getB(in.getRGB(i+1, j-1))/255},
                                            {RGB.getB(in.getRGB(i-1, j))/255,     RGB.getB(in.getRGB(i, j))/255,    RGB.getB(in.getRGB(i+1, j))/255},
                                            {RGB.getB(in.getRGB(i-1, j+1))/255,   RGB.getB(in.getRGB(i, j+1))/255,  RGB.getB(in.getRGB(i+1, j+1))/255}
                            };
                            
                                for(int index=0;index<4;index++){
                                    waga = 0;
                                    for(int k=0;k<3;k++){
                                        for(int l=0;l<3;l++){
                                            if(K[index][k][l]==Math.abs(a[k][l]-1))
                                                waga++;
                                        }
                                    }
                                    if(waga==5){
                                        out.setRGB(i, j,bialy);
                                        zmiany = true;
                                    }
                                }   
                            }
                            
                }      
             }
            in = RGB.powiekszKopiujac(out,0);
        }while(zmiany==true);    
        
        long end_time = System.currentTimeMillis();
        System.out.println("Wykonanie w : "+(end_time-start_time)+"ms");
        return out;
    }