title: JavaFX 2 Save crisp snapshot of scene to disk
body: <p>I'm trying to save a snapshot of my application to disk using JavaFX 2, which should be easy considering FX comes with a built-in snapshot function. It does work, however, the image is fuzzy. The application I'm building relies greatly on getting these images to save clear and crisp. Anyone know why this happens? Or how to fix it so it saves what I'm actually seeing when the app runs?</p>
  
  <p>The top image is what saved to disk, the bottom is my app running:</p>
  
  <p><a href="https://i.stack.imgur.com/cB0XE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cB0XE.png" alt="The top image is what saved to disk, the bottom is my app running."></a></p>
  
  <p>My code for saving the scene is below:</p>
  
  <pre><code>try 
  {
    WritableImage wi = new WritableImage((int) scene.getWidth(), (int) scene.getHeight());
    WritableImage snapshot = scene.snapshot(wi);
    File output = new File("Full.png");
    ImageIO.write(SwingFXUtils.fromFXImage(snapshot, null), "png", output);
  } catch (IOException ex) {
    ex.printStackTrace();
  }
  </code></pre>