title: Apply blur on BMP pixel RGB array
body: <p>I'm trying to apply blur effect, but I'm getting totaly wrong colors
  I'm using Easy_BMP library to load BMP file into pixel array.
  I try to implement gaussian blur alghoritm with refference to <a href="https://stackoverflow.com/questions/1696113/how-do-i-gaussian-blur-an-image-without-using-any-in-built-gaussian-functions">this topic</a>. What's wrong ?</p>
  
  <pre><code>void blur3x3(int i, int j, RGBApixel** pixelArray, BMP &amp;Image) {
  
  double blurValue = 0.111;
  int avgR = 0;
  int avgG= 0 ;
  int avgB = 0;
  
  int b = 0;
  for(int w = i-1 ; w &lt;= i+1 ; w++) {
      for(int z = i-1 ; z&lt;=j+1 ; z++) {
          avgR = avgR + blurValue*( pixelArray[w][z].Red   );
          avgG = avgG + blurValue*( pixelArray[w][z].Green );
          avgB = avgB + blurValue*( pixelArray[w][z].Blue  );
      }
  }
  
  Image(i,j)-&gt;Red = (BYTE) avgR ;
  Image(i,j)-&gt;Green = (BYTE) avgG;
  Image(i,j)-&gt;Blue = (BYTE) avgB;
  
  }
  
  
  bool blur() {
  
  BMP Image;
  Image.ReadFromFile(fullFilePath);
  
  int w = Image.TellWidth();
  int h =  Image.TellHeight();
  
  RGBApixel** pixelArray = new RGBApixel*[w];
  for(int i = 0; i &lt; w; ++i)
      pixelArray[i] = new RGBApixel[h];
  
  for( int i=0 ; i &lt; Image.TellWidth() ; i++) {
      for( int j=0 ; j &lt; Image.TellHeight() ; j++) {
          pixelArray[i][j] = Image.GetPixel(i,j);
      }
  }
  
  for( int i=1 ; i &lt; Image.TellWidth()-1 ; i++) {
      for( int j=1 ; j &lt; Image.TellHeight()-1 ; j++) {
          blur3x3(i,j, pixelArray, Image);
      }
  }
  
  Image.SetBitDepth( 32 );
  Image.WriteToFile( "/home/kxyz/BMP/gray.bmp" );
  }
  </code></pre>