title: Write back modified image from imageReader
body: <p>I read separated images from animated gif and I need just make change with them in <code>frames[i]</code> and then set them back to file and save with writer as new file. </p>
  
  <pre><code>    File file = new File("gif1.gif");
      ImageReader reader = ImageIO.getImageReadersBySuffix("GIF").next();
      ImageInputStream in = ImageIO.createImageInputStream(file);
      reader.setInput(in);
  
      File output = new File("k.gif");
  
      ImageWriter writer = ImageIO.getImageWritersBySuffix("GIF").next();
      ImageOutputStream out = ImageIO.createImageOutputStream(file);
      writer.setOutput(out);
  
      int numImages = reader.getNumImages(true); 
      BufferedImage[] frames = new BufferedImage[pocetObrazku];
  
      for (int i = 0; i &lt; numImages; i++)
      {
  
          BufferedImage image = reader.read(i);
          frames[i] = reader.read(i);        
      }    
  </code></pre>
  
  <p>I'll be glad for any help.</p>