public static void main( String[] args ) throws Exception {
		String sceneName = null;
		HDRExposure sum = null;
		int avgSpp = 0;
		for( String arg : args ) {
			if( arg.endsWith(".dump") ) {
				String dumpFilename = arg;
				File dumpFile = new File(dumpFilename);
				sceneName = dumpFile.getName();
				sceneName = sceneName.substring(0, sceneName.length()-5);
				System.err.println("Loading "+dumpFile+"...");
				HDRExposure exp = ChunkyDump.loadExposure(dumpFile);
				System.err.println("  -> "+exp.width+"x"+exp.height);
				if( exp.e.length > 0 ) {
					// Don't bother averaging; chunky dumps have the same spp everywhere
					avgSpp += (int)exp.e[0];
				}
				if( sum == null ) {
					sum = exp;
				} else {
					sum = addScaleyAndDestructively(sum,exp);
				}
			} else if( arg.endsWith(".rgbe") ) {
				File rgbeFile = new File(arg);
				sceneName = rgbeFile.getName();
				sceneName = sceneName.substring(0, sceneName.length()-5);
				System.err.println("Loading "+rgbeFile+"...");
				HDRExposure exp = RGBE.loadExposureFromRawRgbe(rgbeFile);
				System.err.println("  -> "+exp.width+"x"+exp.height);
				if( exp.e.length > 0 ) {
					// Don't bother averaging; RGBE files have the same spp everywhere
					avgSpp += (int)exp.e[0];
				}
				if( sum == null ) {
					sum = exp;
				} else {
					sum = addScaleyAndDestructively(sum,exp);
				}
			} else {
				System.err.println("Invalid argument: "+arg);
				System.exit(1);
			}
		}
		
		if( sum == null ) {
			System.err.println("No dumps specified!");
			System.exit(1);
			return;
		}
		
		System.err.println("Combined image is "+sum.width+"x"+sum.height);
		
		final Frame f = new Frame("Image adjuster");
		AdjusterUI adj = new AdjusterUI();
		adj.exportFilenamePrefix = sceneName + (avgSpp == 0 ? "" : "-"+avgSpp);
		adj.setExposure(sum);
		f.add(adj);
		f.pack();
		
		f.setVisible(true);
		adj.requestFocus();
		f.addWindowListener( new WindowAdapter() {
			@Override public void windowClosing( WindowEvent evt ) {
				f.dispose();
			}
		});
	}