public void encodeFile(File file) {
        try {
            Color[] colorArray = fileToColorArray(file);

            int colorCounter = 0;

            for (int yScroll = 0; yScroll < currentImg.getHeight(); yScroll += this.heightMod) {
                for (int xScroll = 0; xScroll < currentImg.getWidth(); xScroll += this.widthMod) {
                    if (colorCounter < colorArray.length - 1) {
                        Color tempColor = colorArray[colorCounter];

                        if (tempColor != null) {
                            int r = tempColor.getRed();
                            int g = tempColor.getGreen();
                            int b = tempColor.getBlue();

                            currentImg.setRGB(xScroll, yScroll, tempColor.getRGB());
                            colorCounter++;
                        }
                    }
                }
            }
        } catch (IOException e) {}
    }