public void createFrames(){
        int iter = getIterations();
        frames = new BufferedImage[iter+1];
        frames[0] = imageToEncryptDecrypt;
        // If animation mode 0 then we need to create encryption frames.
        if(getAnimationMode() == 0){
            for(int i = 1; i <= iter; i++){
                fractal.createFractal(i);
                creator = new ImageCreator(fractal.getNewPixels(), 
                                           handler.getPaddedImageLength(),
                                           handler.getPaddedImageLength());
                frames[i] = creator.createImage();
                
            }
        }
        // If animation mode 1 then we need to create decryption frames.
        if(getAnimationMode() == 1){
            for(int i = 1; i <= iter; i++){
                int[] transforms;
                transforms = SquareDihedralGroup.inverseTransformations(
                        getTransf());
                fractal = new Fractal(handler.getPaddedPixels(),
                                      handler.getPaddedImageLength(),
                                      transforms);
                fractal.destroyFractal(i);
                creator = new ImageCreator(fractal.getNewPixels(), 
                                           handler.getPaddedImageLength(),
                                           handler.getPaddedImageLength());
                if(getCropWidth() == 0 || getCropHeight() == 0){
                    setCropWidth(handler.getPaddedImageLength());
                    setCropHeight(handler.getPaddedImageLength());
                }
                BufferedImage img = creator.createImage();
                BufferedImage img2 = handler.cropImage(img,getCropWidth(), 
                                                       getCropHeight());
                if(img2 != null){
                    frames[i] = img2;
                } else {
                    frames[i] = img;
                }
                
            }
        }
    }