Пример #1
0
  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;
  }
Пример #2
0
 public static void writeExp(float[][] image, String name) throws IOException {
   Tools.writePNG(MetalTools.toImage(exp(image), 128), name);
 }