How do i merge multiple .png images as a single image using java?
<p>I want to send multiple .png images as an single image through servlet <code>response.getOutputStream().write(encoder.pngEncode());</code>
But i can send only one image at a time,but i need to send multiple images through response object using java.  If anyone knows please give me your inputs.</p>

<pre><code>   // Create a set of charts
   JFreeChart chart1=null;

   BufferedImage buf[] = new BufferedImage[5]; 
   PngEncoder encoder[] = new PngEncoder[5]; 
   for (int i=0; i&lt;5; i++ ) 
   {            
       buf[i] = chart[i].createBufferedImage(400, 350, null); 
       encoder[i] = new PngEncoder( buf[i], false, 0, 9 ); 
       System.out.println("i= "+i); 
       resp.getOutputStream().write( encoder[i].pngEncode() );           
   }
</code></pre>
