public void clearArea(ImageFrame img_frame, int x, int y, int width, int height)
    {
        //clear this area from main picture
        Image img = img_frame.getJIPTImage().getImage();    //get main image
        int totalWidth = img.getWidth(main_frame);      //get main picture width
        int totalHeight = img.getHeight(main_frame);    //get main picture height
        int originImageData[] = new int[ totalWidth * totalHeight ];    //make image array for main picture

        PixelGrabber pg = new PixelGrabber(img, 0, 0, -1, -1, true);     //get main picture array
        try
        {
            pg.grabPixels();
        }
        catch(Exception e)
        {
            // System.out.println(e.toString());
        }
        originImageData = (int []) pg.getPixels();

        //get clearPixelColor from jipt_settings
        int clearPixel = main_frame.getJIPTsettings().getClearPixelColor();

        //traverse image array and clear out selected area (x,y, x+width, y+height)
        int pos = 0;
        for(int j=0; j<totalHeight; j++ )
            for( int i=0; i<totalWidth; i++ )
            {
                if( ( (i>=x) && (i<(x+width)) ) && ( (j>=y) && (j<(y+height)) ) )
                {
                    originImageData[pos] = clearPixel;
                }
                pos++;
            }

        //create image from imageData
        img = Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(totalWidth,
                totalHeight,originImageData,0,totalWidth));

        //apply new image
        img_frame.setFrameImage( img, true );
    }