public static BufferedImage getGreenImage(final int stitch, final int image) throws IOException { File file = new File(Cache.CACHE.getCanonicalPath() + "/images-green/" + stitch + "/" + image + ".png"); if (file.exists()) return ImageIO.read(file); BufferedImage result = MetalTools.toImage(getInterpolatedImage(stitch, image), 128); Tools.ensurePath(file.getAbsolutePath()); ImageIO.write(result, "png", file); return result; }
public static void writeExp(float[][] image, String name) throws IOException { Tools.writePNG(MetalTools.toImage(exp(image), 128), name); }