title: CS50 week 4 - Filter less - sepia doesn't work for 3x3
body: <p>Can someone tell me why the code doesnt work in 3x3 images, but it does work with 4x4 and single pixel? Everything seems to be correct, and I checked a lot of codes in google and stack overflow and they are similar. These are the results I get from check50:</p>
  <p>:) sepia correctly filters single pixel</p>
  <p>:( sepia correctly filters simple 3x3 image</p>
  <p>expected &quot;100 89 69\n100...&quot;, not &quot;100 89 69\n100...&quot;</p>
  <p>:( sepia correctly filters more complex 3x3 image</p>
  <p>expected &quot;25 22 17\n66 5...&quot;, not &quot;25 22 17\n66 5...&quot;</p>
  <p>:) sepia correctly filters 4x4 image</p>
  <p>Apparently the problem is in the fourth and seventh line:</p>
  <p>Expected Output:</p>
  <p>100 89 69</p>
  <p>100 89 69</p>
  <p>100 89 69</p>
  <p>196 175 136</p>
  <p>196 175 136</p>
  <p>196 175 136</p>
  <p>48 43 33</p>
  <p>48 43 33</p>
  <p>48 43 33</p>
  <p>Actual Output:</p>
  <p>100 89 69</p>
  <p>100 89 69</p>
  <p>100 89 69</p>
  <p>237 211 165</p>
  <p>196 175 136</p>
  <p>196 175 136</p>
  <p>58 52 40</p>
  <p>48 43 33</p>
  <p>48 43 33</p>
  <pre><code>void sepia(int height, int width, RGBTRIPLE image[height][width])
  {
  int sepiaRed;
  int sepiaGreen;
  int sepiaBlue;
  
  for(int h = 0; h &lt; height; h++)
  {
      for(int w = 0; w &lt; width; w++)
      {
          sepiaRed = round (.393 * image[h][w].rgbtRed + .769 * image[h][w].rgbtGreen + .189 * image[h][w].rgbtBlue);
          sepiaGreen = round (.349 * image[h][w].rgbtRed + .686 * image[h][w].rgbtGreen + .168 * image[h][w].rgbtBlue);
          sepiaBlue = round (.272 * image[h][w].rgbtRed + .534 * image[h][w].rgbtGreen + .131 * image[h][w].rgbtBlue);
  
          if(sepiaBlue &gt; 255)
          {
              sepiaBlue = 255;
          }
          if(sepiaGreen &gt; 255)
          {
              sepiaGreen = 255;
          }
          if(sepiaRed &gt; 255)
          {
              sepiaRed = 255;
          }
  
          image[h][w].rgbtBlue = sepiaBlue;
          image[h][w].rgbtGreen = sepiaGreen;
          image[h][w].rgbtRed = sepiaRed;
      }
  }
  return;
  }
  </code></pre>
  <p>(please keep in mind I´m new to programming, 16 years old and english is not my first lenguage)</p>