public void generateImage() {
        int image_width, image_height;
        try {
            //Get the dimensions of the screen in order to determine how large to render the image
            Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();

            //Define the width and height of the image
            image_width = (int) (screenSize.getWidth() / 3);
            image_height = (int) (screenSize.getHeight() / 3);
        } catch (Exception e) {
            //If there was an error getting the screen size, set default width and height values
            image_width = 1920;
            image_height = 1080;
        }

        /*
        For reasons as yet unknown, the Java PNG reader freaks out when it tries to read PNG files whose dimensions
        are not divisible by 4. Thus, add a few pixels to the width and height if necessary to enforce divisibility
        by 4.
         */
        if (image_width % 4 != 0) {
            image_width += 4 - image_width % 4;
        }
        if (image_height % 4 != 0) {
            image_height += 4 - image_height;
        }

        //Call the C-Backend to render the image and save it to a file
        ProcessBuilder processBuilder = new ProcessBuilder(new String[]{
                "C-Genetics/aesthetics", "-save", "-p", "100000",
                "-s", "" + image_width, "" + image_height,
                IMAGE_PATH + id,
                x.toString(), y.toString(), z.toString(),
                r.toString(), g.toString(), b.toString()});
        try {
            Process p = processBuilder.start();
            p.waitFor();
            p.destroy();
        } catch (IOException e) {
            e.printStackTrace();
        } catch (InterruptedException e) {

        }
    }