public static Configuration fromFile(String filename) {
        Configuration c = null;
        InputStream i = null;
        try {
            Properties prop = new Properties();
            i = new FileInputStream(filename);
            prop.load(i);

            String picname = prop.getProperty("picname");

            int xSteps = Integer.parseInt(prop.getProperty("xsteps"));
            int ySteps = Integer.parseInt(prop.getProperty("ysteps"));
            int colorSteps = Integer.parseInt(prop.getProperty("colorsteps"));
            int alphaSteps = Integer.parseInt(prop.getProperty("alphasteps"));
            
            int maxTriangles = Integer.parseInt(prop.getProperty("maxtriangles"));

            c = new Configuration(picname, xSteps, ySteps, colorSteps, alphaSteps, maxTriangles);
        } catch (Exception ex) {
            Logger.getLogger(Configuration.class.getName()).log(Level.SEVERE, null, ex);
        } finally {
            if (i != null) {
                try {
                    i.close();
                } catch (IOException e) {
                    Logger.getLogger(Configuration.class.getName()).log(Level.SEVERE, null, e);
                }
            }
        }
        return c;
    }