title: (PSET4 Filter "grayscale") What exactly is check50 saying is wrong about my code?
body: <p>I'm tasked with writing a program that applies a gray scale filter to a given image. This is done by looping over each pixel and averaging the rgb values. When I check my code, I receive an error which seems to say &quot;ERROR: expected X, received X&quot;. Any clarifications of the error message or comments about possible bugs are appreciated.</p>
  <p>My code loops over each pixel in each row of an array of pixels which are described as <code>RGBTRIPLES</code>, structs comprised of 3 <code>uint8_t</code>'s. In the case of a non-whole-number average the program rounds <em>up</em> to the nearest whole number. My answer is the code included below.</p>
  <p>My problem comes when I run <code>check50 cs50/problems/2021/x/filter/more</code>, a program which tests students' programs against keys made by the course designers. The 7th test check's the program's accuracy in filtering a &quot;complex&quot; 3x3 image; I get the following result:</p>
  <pre><code>:( grayscale correctly filters more complex 3x3 image
      expected &quot;20 20 20\n50 5...&quot;, not &quot;20 20 20\n50 5...&quot;
  </code></pre>
  <p>I am confused as it seems that my output matches the expected. Could someone give me a hint as to what my problem is?</p>
  <p>My code:</p>
  <pre><code>void grayscale(int height, int width, RGBTRIPLE image[height][width])
  {
      //Loop over pixels
      for (int y = 0; y &lt; height; y++)
      {
          for (int x = 0; x &lt; width; x++)
          {
  
              //Average out rgbs to get a corresponding greyscale value
              BYTE average_activation = ceil(((float) image[y][x].rgbtBlue + image[y][x].rgbtRed + image[y][x].rgbtGreen) / 3);
              RGBTRIPLE resultant_pixel = {average_activation, average_activation, average_activation};
  
              //apply
              image[y][x] = resultant_pixel;
          }
      }
  
      return;
  }
  </code></pre>