title: How to manipulate BufferedImage
body: <p><code>Processing</code> has a class named <code>PImage</code> from which you can get an array of <code>int</code> that contains values for all pixels. Then, you manipulate this array and call <code>updatePixels()</code> and voila you have applied an effect to the image.  </p>
  
  <p>I was wondering if the same can be done in <code>BufferedImage</code> with some appropriate mechanism. I found that <code>BufferedImage</code> does indeed have a method to get pixels as <code>int[]</code>:  </p>
  
  <pre><code>public int[] getRGB(int startX,
                      int startY,
                      int w,
                      int h,
                      int[] rgbArray,
                      int offset,
                      int scansize)
  Returns an array of integer pixels in the default RGB color model (`TYPE_INT_ARGB`) and default sRGB color space, from a portion of the image data. 
  Color conversion takes place if the default model does not match the image `ColorModel`. 
  There are only 8-bits of precision for each color component in the returned data when using this method.  
  </code></pre>
  
  <p>How do I modify these  pixels and show the appropriate changes in <code>BufferedImage</code> ?</p>
  
  <p>I guess I will need to obtain a <code>WritableRaster</code> for the image and use </p>
  
  <pre><code>public void setPixels(int x,
                        int y,
                        int w,
                        int h,
                        int[] iArray)  
  </code></pre>
  
  <p>but I am still unsure.</p>