private void convertPixelToRGB() {
        rgbArray = new int[height][width][3];
        int rgb;
        for (int row = 0; row < height; row++) {
            for (int col = 0; col < width; col++) {
                rgb = img.getRGB(col, row);
                rgbArray[row][col][0] = (rgb >> 16) & 0xff; //red
                rgbArray[row][col][1] = (rgb >> 8) & 0xff; // green
                rgbArray[row][col][2] = rgb & 0xff; // blue
            }
        }
        convertRGBtoYCbCr();
    }